fix(library): optimize image scanning, fast raw preview extraction and lazy thumbnail loading

This commit is contained in:
2026-10-05 06:34:37 +07:00
parent 554e121e41
commit 91722861f2
12 changed files with 625 additions and 160 deletions
+18
View File
@@ -936,6 +936,24 @@ export function Workspace() {
void forgetPhoto();
}, [clearPreview]);
// Clean up Object URLs when App unmounts (e.g. SPA navigation to Library)
useEffect(() => {
return () => {
setPreviewUrl((prev) => {
if (prev) URL.revokeObjectURL(prev);
return null;
});
setCompareUrl((prev) => {
if (prev) URL.revokeObjectURL(prev);
return null;
});
setSource((prev) => {
if (prev) URL.revokeObjectURL(prev.url);
return null;
});
};
}, []);
// What the phone app gets from the OS geocoder, the browser has no twin of,
// so the name behind a coordinate comes from the API. Fire and forget: the
// stamp is already readable without it, and a name that arrives late (or not