From 47953abece7cb11161d417cb56bcd1b5c5646dcf Mon Sep 17 00:00:00 2001 From: Jared Schoeny Date: Fri, 12 Dec 2025 20:28:10 -1000 Subject: [PATCH] Increase timeout to fix patch count update bug --- src/components/Hack/HackActions.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Hack/HackActions.tsx b/src/components/Hack/HackActions.tsx index da451b7..866719e 100644 --- a/src/components/Hack/HackActions.tsx +++ b/src/components/Hack/HackActions.tsx @@ -221,7 +221,7 @@ const HackActions: React.FC = ({ deviceId = crypto.randomUUID(); localStorage.setItem(key, deviceId); } - // Defer update to next tick to avoid Safari cancelling the request + // Defer count update to avoid Safari cancelling the request setTimeout(async () => { const deviceIdObscured = deviceId.split("-"); const result = await updatePatchDownloadCount(patchId, deviceIdObscured); @@ -230,9 +230,11 @@ const HackActions: React.FC = ({ } else if (result.didIncrease) { window.dispatchEvent(new CustomEvent("hack:patch-applied", { detail: { slug: hackSlug } })); } - }, 0); + }, 50); } - } catch {} + } catch (e: any) { + console.error(e); + } } catch (e: any) { setError(e?.message || "Failed to patch ROM"); setStatus("idle");