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:
parent
c96c7855c6
commit
a4124949d1
@ -58,6 +58,12 @@ export default function RootLayout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function flushQueuedNoteMutations(): Promise<void> {
|
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() }));
|
const result = await flushNoteQueue().catch(() => ({ flushed: 0, failed: getNoteQueueSize() }));
|
||||||
setQueueStatus({
|
setQueueStatus({
|
||||||
pending: result.failed,
|
pending: result.failed,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user