Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(settings): reset the account-row offer while a new availability check is pending
ARAYN70111a6a624187cb
diff --git a/src/components/AccountMenu.sheet.test.ts b/src/components/AccountMenu.sheet.test.tsindex 3913679539..d47d4ce787 100644--- a/src/components/AccountMenu.sheet.test.ts+++ b/src/components/AccountMenu.sheet.test.ts@@ -61,3 +61,12 @@ it("hides the row again when a later check fails after an earlier yes", async ()f.effects[0]!(); await flush(); render();expect(result).toBe(false);});++it("drops an earlier yes while a new check is still pending", async () => {+ const offered = vi.fn().mockResolvedValueOnce(true).mockReturnValueOnce(new Promise(() => {}));+ vi.stubGlobal("window", { ogb: { accountSheet: { offered, open: vi.fn() } } });+ render(); f.effects[0]!(); await flush(); render();+ expect(result).toBe(true);+ f.effects[0]!(); render();+ expect(result).toBe(false);+});diff --git a/src/components/AccountMenu.tsx b/src/components/AccountMenu.tsxindex 72e88a69eb..29fe5be6cc 100644--- a/src/components/AccountMenu.tsx+++ b/src/components/AccountMenu.tsx@@ -39,6 +39,7 @@ export function useSheetOffered(enabled = true): boolean {useEffect(() => {if (!enabled || !remote) return;let alive = true;+ setOffered(false); // a new check starts from "no", so an old yes never shows while it is pendingvoid remote.offered().then((yes) => { if (alive) setOffered(yes === true); }).catch(() => { if (alive) setOffered(false); });return () => { alive = false; };}, [enabled, remote]);