()
| 80 | |
| 81 | // Flush any pending debounced upload immediately (e.g. on page unload) |
| 82 | export function flushPendingUpload(): void { |
| 83 | if (uploadTimer && pendingUserId) { |
| 84 | clearTimeout(uploadTimer); |
| 85 | uploadTimer = null; |
| 86 | const uid = pendingUserId; |
| 87 | pendingUserId = null; |
| 88 | doUpload(uid); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | // Merge from a realtime payload (no API call needed). |
| 93 | // Returns true if any data actually changed locally. |
no test coverage detected