Live-update queue list when upload status changes
Storage.updatePhoto() now fires a 'photo-updated' CustomEvent so the queue page refreshes immediately (300ms debounce) when the sync engine changes a photo's status, instead of waiting for the 5s poll. Also reduces background poll to 30s (just a fallback now), and revokes stale ObjectURLs on each rebuild to prevent memory leaks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -93,7 +93,14 @@ const Storage = {
|
||||
},
|
||||
|
||||
async updatePhoto(id, updates) {
|
||||
return await this.db.photos.update(id, updates);
|
||||
const result = await this.db.photos.update(id, updates);
|
||||
// Notify any listening UI (e.g. queue page) of the change
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('photo-updated', {
|
||||
detail: { id: id, updates: updates }
|
||||
}));
|
||||
} catch (e) { /* ignore if no window context */ }
|
||||
return result;
|
||||
},
|
||||
|
||||
async deletePhoto(id) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// NextSnap Service Worker
|
||||
// Provides offline-first caching for the app shell
|
||||
|
||||
const CACHE_VERSION = 'nextsnap-v15';
|
||||
const APP_SHELL_CACHE = 'nextsnap-shell-v11';
|
||||
const RUNTIME_CACHE = 'nextsnap-runtime-v11';
|
||||
const CACHE_VERSION = 'nextsnap-v16';
|
||||
const APP_SHELL_CACHE = 'nextsnap-shell-v12';
|
||||
const RUNTIME_CACHE = 'nextsnap-runtime-v12';
|
||||
|
||||
// Assets to cache on install
|
||||
const APP_SHELL_ASSETS = [
|
||||
|
||||
Reference in New Issue
Block a user