typescript-typenfehler behoben.. npm run lint läuft nun fehlerfrei durch.
This commit is contained in:
@@ -30,7 +30,9 @@ export async function enqueue(item: Omit<QueueItem, 'id' | 'status' | 'retries'
|
||||
try {
|
||||
const reg = await navigator.serviceWorker.ready;
|
||||
(reg as ServiceWorkerRegistration & { sync?: SyncManager }).sync?.register('upload-queue');
|
||||
} catch {}
|
||||
} catch (error) {
|
||||
console.warn('Background sync registration failed', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +85,9 @@ async function attemptUpload(it: QueueItem): Promise<boolean> {
|
||||
(pct) => {
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('queue-progress', { detail: { id: it.id, progress: pct } }));
|
||||
} catch {}
|
||||
} catch (error) {
|
||||
console.warn('Queue progress dispatch failed', error);
|
||||
}
|
||||
}
|
||||
);
|
||||
// mark my-photo-ids for "Meine"
|
||||
@@ -91,7 +95,9 @@ async function attemptUpload(it: QueueItem): Promise<boolean> {
|
||||
const raw = localStorage.getItem('my-photo-ids');
|
||||
const arr: number[] = raw ? JSON.parse(raw) : [];
|
||||
if (json.id && !arr.includes(json.id)) localStorage.setItem('my-photo-ids', JSON.stringify([json.id, ...arr]));
|
||||
} catch {}
|
||||
} catch (error) {
|
||||
console.warn('Failed to persist my-photo-ids', error);
|
||||
}
|
||||
notify('Upload erfolgreich', 'success');
|
||||
return true;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user