fix(library): fix scanning spinner icon on active folder nodes and live counts update
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
|||||||
jumpScan,
|
jumpScan,
|
||||||
listEditedIds,
|
listEditedIds,
|
||||||
listFolders,
|
listFolders,
|
||||||
|
normPath,
|
||||||
pickFolder,
|
pickFolder,
|
||||||
readPhotoFile,
|
readPhotoFile,
|
||||||
readPhotos,
|
readPhotos,
|
||||||
@@ -1653,13 +1654,16 @@ function Catalogue() {
|
|||||||
// nothing about the folder the reading is actually in. The
|
// nothing about the folder the reading is actually in. The
|
||||||
// frames that sit in the roll's own folder are the one case
|
// frames that sit in the roll's own folder are the one case
|
||||||
// left bare, and the toolbar's line is what carries them.
|
// left bare, and the toolbar's line is what carries them.
|
||||||
const dir = relOf(n.key);
|
const isScanFolderMatch = !!(live && folder && normPath(live.folder) === normPath(folder.name));
|
||||||
const at = live && live.folder === folder?.name && live.progress.at ? `${live.progress.at}/` : null;
|
const scanAt = live?.progress.at ? normPath(live.progress.at) : '';
|
||||||
const scanning = dir !== null && dir !== '' && at !== null && (dir === at || at.startsWith(dir));
|
const nodeRel = (relOf(n.key) ?? '').replace(/\/$/, '');
|
||||||
// A row whose reading has not started yet: the ring is
|
const scanning = isScanFolderMatch && (
|
||||||
// there, held still, so a reader sees the roll is pending
|
n.depth === 0 ? true : (scanAt === nodeRel || scanAt.startsWith(nodeRel ? `${nodeRel}/` : ''))
|
||||||
// rather than idle.
|
);
|
||||||
const waiting = dir !== null && dir !== '' && !scanning && scanQueue().some((j) => j.folder === folder?.name && j.rel === dir);
|
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);
|
const under = parents.has(n.key);
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user