From 234246e7eec999ad7b205ea6512b18a29cb1bf5b Mon Sep 17 00:00:00 2001 From: Kojib <123880127+kojibai@users.noreply.github.com> Date: Sat, 31 Jan 2026 21:05:16 -0500 Subject: [PATCH] Fix mobile note claim update before download --- src/pages/VerifyPage.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/VerifyPage.tsx b/src/pages/VerifyPage.tsx index 1f002a6f..eaff00d8 100644 --- a/src/pages/VerifyPage.tsx +++ b/src/pages/VerifyPage.tsx @@ -3357,6 +3357,12 @@ React.useEffect(() => { noteDownloadInFlightRef.current = false; return; } + let confirmIssued = false; + const confirmOnce = () => { + if (confirmIssued) return; + confirmIssued = true; + confirmNoteSend(); + }; try { const payloadBase = noteSendPayloadRaw @@ -3401,11 +3407,13 @@ React.useEffect(() => { ].filter((entry): entry is { keyword: string; text: string } => Boolean(entry)); if (entries.length === 0) { + confirmOnce(); triggerDownload(filename, png, "image/png"); } else { const bytes = new Uint8Array(await png.arrayBuffer()); const enriched = insertPngTextChunks(bytes, entries); const finalBlob = new Blob([enriched as BlobPart], { type: "image/png" }); + confirmOnce(); triggerDownload(filename, finalBlob, "image/png"); } @@ -3416,7 +3424,7 @@ React.useEffect(() => { noteDownloadBypassRef.current = false; noteDownloadInFlightRef.current = false; // ✅ ALWAYS flip claim + force UI refresh (mobile-safe) - confirmNoteSend(); + confirmOnce(); } }, [confirmNoteSend, noteClaimedFinal, noteProofBundleJson, noteSendMeta, noteSendPayloadRaw, noteSvgFromPng, sharedReceipt]);