This commit is contained in:
m
2026-08-25 17:04:17 +02:00
parent 7e7d669d63
commit a791df26bf
8 changed files with 130 additions and 38 deletions
+10 -6
View File
@@ -28,19 +28,23 @@ export function useSyncQueue() {
return;
}
const registry = fileStore.getPendingSync();
const allFolders = safDirectory.getAll();
const autoFolderIds = new Set(
allFolders.filter((f) => f.syncMode === 'auto').map((f) => f.id)
);
const registry = fileStore.getAllLocal();
let count = 0;
for (const entry of registry) {
if (entry.backendId || !entry.localUri) continue;
if (entry.syncStatus !== 'local' && entry.syncStatus !== 'error') continue;
if (globalMode === 'auto') {
count++;
} else {
// mode manuel : uniquement les fichiers des dossiers en mode auto
if (!entry.parentResourceId) continue;
const folder = safDirectory.getAll().find((f) => f.id === entry.parentResourceId);
if (folder && folder.syncMode === 'auto') {
count++;
}
if (!entry.parentResourceId || !autoFolderIds.has(entry.parentResourceId)) continue;
count++;
}
}