revert evictFromCache, add back delay + marks invalidation
Remove evictFromCache entirely - the cache-manipulation approach was brittle and broke both archive (photos not removed) and tags (colors/ratings showing empty). Replace with: 200ms delay before invalidation to let PhotoPrism's indexer process the change, plus invalidateQueries(['marks']) so tag caches (colors, ratings, notes) refresh alongside the photo timeline.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { batchEdit } from './batch';
|
||||
import { invalidatePhotos, evictFromCache } from './bulk';
|
||||
import { invalidatePhotos } from './bulk';
|
||||
import {
|
||||
approvePhoto,
|
||||
batchArchive,
|
||||
@@ -68,7 +68,6 @@ export async function dismissPhotos(uids: string[]): Promise<void> {
|
||||
if (uids.length === 0) return;
|
||||
const tid = toast.loading(`Dismissing ${uids.length}…`);
|
||||
const { updated, errors } = await batchEdit(uids, (id) => approvePhoto(id));
|
||||
evictFromCache(uids);
|
||||
focusAfter(uids);
|
||||
clearSelection();
|
||||
invalidatePhotos(uids);
|
||||
@@ -108,7 +107,6 @@ export async function acceptDateAndKeep(uids: string[]): Promise<void> {
|
||||
await approvePhoto(id);
|
||||
return id;
|
||||
});
|
||||
evictFromCache(uids);
|
||||
focusAfter(uids);
|
||||
clearSelection();
|
||||
invalidatePhotos(uids);
|
||||
@@ -135,7 +133,6 @@ export async function archivePhotos(uids: string[]): Promise<void> {
|
||||
toast.error(err instanceof Error ? err.message : 'Archive failed', { id: tid });
|
||||
return;
|
||||
}
|
||||
evictFromCache(uids);
|
||||
pushUndo(`Archived ${uids.length}`, async () => {
|
||||
await batchRestore(uids);
|
||||
invalidatePhotos(uids);
|
||||
|
||||
Reference in New Issue
Block a user