()
| 98 | } |
| 99 | |
| 100 | private async loadPersistedQueue() { |
| 101 | if (!this.storage) { |
| 102 | return; |
| 103 | } |
| 104 | try { |
| 105 | const stored = await this.storage.getItem(QUEUE_STORAGE_KEY); |
| 106 | if (stored) { |
| 107 | const items = JSON.parse(stored); |
| 108 | if (Array.isArray(items) && items.length > 0) { |
| 109 | this.queue = [...items, ...this.queue]; |
| 110 | this.flush(); |
| 111 | } |
| 112 | } |
| 113 | } catch { |
| 114 | this.log('Failed to load persisted queue'); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | private persistQueue() { |
| 119 | if (!this.storage) { |
no test coverage detected