fix(library): fix scanning spinner icon on active folder nodes and live counts update

This commit is contained in:
2026-10-07 21:53:22 +07:00
parent f8a8844f6d
commit 8bc5e08926
+11 -7
View File
@@ -19,6 +19,7 @@ import {
jumpScan,
listEditedIds,
listFolders,
normPath,
pickFolder,
readPhotoFile,
readPhotos,
@@ -1653,13 +1654,16 @@ function Catalogue() {
// nothing about the folder the reading is actually in. The
// frames that sit in the roll's own folder are the one case
// left bare, and the toolbar's line is what carries them.
const dir = relOf(n.key);
const at = live && live.folder === folder?.name && live.progress.at ? `${live.progress.at}/` : null;
const scanning = dir !== null && dir !== '' && at !== null && (dir === at || at.startsWith(dir));
// A row whose reading has not started yet: the ring is
// there, held still, so a reader sees the roll is pending
// rather than idle.
const waiting = dir !== null && dir !== '' && !scanning && scanQueue().some((j) => j.folder === folder?.name && j.rel === dir);
const isScanFolderMatch = !!(live && folder && normPath(live.folder) === normPath(folder.name));
const scanAt = live?.progress.at ? normPath(live.progress.at) : '';
const nodeRel = (relOf(n.key) ?? '').replace(/\/$/, '');
const scanning = isScanFolderMatch && (
n.depth === 0 ? true : (scanAt === nodeRel || scanAt.startsWith(nodeRel ? `${nodeRel}/` : ''))
);
const waiting = !scanning && isScanFolderMatch && scanQueue().some((j) => {
const qRel = (j.rel ?? '').replace(/\/$/, '');
return qRel === nodeRel || qRel.startsWith(nodeRel ? `${nodeRel}/` : '');
});
const under = parents.has(n.key);
return (
<button