Skip to content

Commit efe8674

Browse files
committed
fix(desktop): use path-keyed reconcile for stable list updates
1 parent 439ef95 commit efe8674

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • apps/desktop/src/routes/(window-chrome)/new-main

apps/desktop/src/routes/(window-chrome)/new-main/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,13 @@ function Page() {
11441144
createEffect(() => {
11451145
const data = recordings.data;
11461146
if (!data) {
1147-
setRecordingsStore(reconcile([]));
1147+
setRecordingsStore(reconcile([], { key: "path" }));
11481148
return;
11491149
}
11501150
const mapped = data
11511151
.slice(0, 20)
11521152
.map(([path, meta]) => ({ ...meta, path }) as RecordingWithPath);
1153-
setRecordingsStore(reconcile(mapped));
1153+
setRecordingsStore(reconcile(mapped, { key: "path" }));
11541154
});
11551155
const recordingsData = () => recordingsStore;
11561156

@@ -1160,10 +1160,10 @@ function Page() {
11601160
createEffect(() => {
11611161
const data = screenshots.data;
11621162
if (!data) {
1163-
setScreenshotsStore(reconcile([]));
1163+
setScreenshotsStore(reconcile([], { key: "path" }));
11641164
return;
11651165
}
1166-
setScreenshotsStore(reconcile(data.slice(0, 20)));
1166+
setScreenshotsStore(reconcile(data.slice(0, 20), { key: "path" }));
11671167
});
11681168
const screenshotsData = () => screenshotsStore;
11691169

0 commit comments

Comments
 (0)