stopped load flickering
This commit is contained in:
@@ -1035,7 +1035,14 @@ export const initStore = async () => {
|
|||||||
const taskMap = new Map(currentTasks.map(t => [t.id, t]));
|
const taskMap = new Map(currentTasks.map(t => [t.id, t]));
|
||||||
allIncomplete.forEach((r: any) => {
|
allIncomplete.forEach((r: any) => {
|
||||||
if (r.tags?.includes("__template__")) return;
|
if (r.tags?.includes("__template__")) return;
|
||||||
|
|
||||||
const existing = taskMap.get(r.id);
|
const existing = taskMap.get(r.id);
|
||||||
|
|
||||||
|
// Prevent DOM rebuilding/flickering for tasks that haven't changed
|
||||||
|
if (existing && existing.updated === r.updated) {
|
||||||
|
return; // Keeps the exact same reference in the map
|
||||||
|
}
|
||||||
|
|
||||||
// If existing has content, keep it. Otherwise use new record (which likely has no content yet)
|
// If existing has content, keep it. Otherwise use new record (which likely has no content yet)
|
||||||
const newTask = mapRecordToTask(r);
|
const newTask = mapRecordToTask(r);
|
||||||
if (existing && existing.content) {
|
if (existing && existing.content) {
|
||||||
|
|||||||
Reference in New Issue
Block a user