perf: evict archived/deleted photos from cache immediately
Remove archived/restored/deleted/approved UIDs from all cached photo-list pages right after the API confirms, so the grid updates on the same tick instead of waiting for a network round-trip. Also removes the 400ms doneBulk animation delay (now unnecessary since tiles vanish instantly).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { batchEdit } from '$lib/services/batch';
|
||||
import { invalidatePhotos } from '$lib/services/bulk';
|
||||
import { invalidatePhotos, evictFromCache } from '$lib/services/bulk';
|
||||
import {
|
||||
addToHeap,
|
||||
approvePhoto,
|
||||
@@ -194,6 +194,7 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
|
||||
return;
|
||||
}
|
||||
doneBulk(doneLabel, ids);
|
||||
evictFromCache(ids);
|
||||
focusAfter(ids);
|
||||
clearSelection();
|
||||
invalidatePhotos(ids);
|
||||
@@ -233,6 +234,7 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
|
||||
return;
|
||||
}
|
||||
doneBulk(`Deleted ${ids.length}`, ids);
|
||||
evictFromCache(ids);
|
||||
focusAfter(ids);
|
||||
clearSelection();
|
||||
invalidatePhotos(ids);
|
||||
@@ -270,6 +272,7 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
|
||||
doneBulk(`Kept ${ids.length}`, ids);
|
||||
toast.success(`Kept ${ids.length}`, { id: tid });
|
||||
}
|
||||
evictFromCache(ids);
|
||||
focusAfter(ids);
|
||||
clearSelection();
|
||||
invalidatePhotos(ids);
|
||||
|
||||
Reference in New Issue
Block a user