(newStatus: SyncStatus, message?: string)
| 249 | } |
| 250 | |
| 251 | export function updateSyncStatus(newStatus: SyncStatus, message?: string) { |
| 252 | localStorage.setItem(`syncStatus`, JSON.stringify([newStatus, message])) |
| 253 | // Fire a storage event on this tab as this doesn't happen automatically |
| 254 | window.dispatchEvent( |
| 255 | new StorageEvent(`storage`, { |
| 256 | key: `syncStatus`, |
| 257 | newValue: JSON.stringify([newStatus, message]), |
| 258 | }) |
| 259 | ) |
| 260 | } |
| 261 | |
| 262 | export function useSyncStatus() { |
| 263 | const currentSyncStatusJson = localStorage.getItem(`syncStatus`) |
no test coverage detected