From a4124949d1c30bd63748f5fc5ee472e733fdea3e Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Tue, 31 Mar 2026 00:52:24 -0700 Subject: [PATCH] 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 --- mobile/src/app/_layout.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mobile/src/app/_layout.tsx b/mobile/src/app/_layout.tsx index 4b874c1..340dfd6 100644 --- a/mobile/src/app/_layout.tsx +++ b/mobile/src/app/_layout.tsx @@ -58,6 +58,12 @@ export default function RootLayout() { } async function flushQueuedNoteMutations(): Promise { + 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,