fix(mobile): auto-dismiss queue status banner when queue is empty

- Skip flush call and clear lastFlushed when getNoteQueueSize() is 0
- Prevents stale 'Flushed on last attempt: N' persisting after queue drains
This commit is contained in:
saravanakumardb1 2026-03-31 00:52:24 -07:00
parent c96c7855c6
commit a4124949d1

View File

@ -58,6 +58,12 @@ export default function RootLayout() {
}
async function flushQueuedNoteMutations(): Promise<void> {
const pending = getNoteQueueSize();
if (pending === 0) {
setQueueStatus({ pending: 0, lastFlushed: 0 });
return;
}
const result = await flushNoteQueue().catch(() => ({ flushed: 0, failed: getNoteQueueSize() }));
setQueueStatus({
pending: result.failed,