cheogram-www
created pr with
cheogram-www/react-compiler-fixes.1
commented
Changes are available at https://tangled.org/mrry.band/cheogram-www on branch react-compiler-fixes.
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-www:react-compiler-fixes | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:react-compiler-fixes [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:react-compiler-fixesadd comment to patch request:
ssh pr.pico.sh comment cheogram-www:react-compiler-fixes "lgtm!"
Patchset
cheogram-www/react-compiler-fixes.1
Test each file for compilability
Eric Roberts
Fix Account.tsx for react-compiler
2026-11-10T17:11:18ZEric Roberts
→ Fix Accounts.tsx for react-compiler
2026-11-10T17:23:58ZEric Roberts
Fix Chat.tsx for react-compiler
2026-11-10T17:26:31ZEric Roberts
Fix Chats.tsx for react-compiler
2026-11-10T17:29:12ZEric Roberts
Fix Login.tsx for react-compiler
2026-11-10T17:32:03ZEric Roberts
Fix MessageDebugger.tsx for react-compiler
2026-11-10T17:33:10ZEric Roberts
Fix MessageMenuInChat.tsx for react-compiler
2026-11-10T17:33:57ZEric Roberts
Fix Quill.tsx for react-compiler
2026-11-10T17:34:29ZEric Roberts
Fix Register.tsx for react-compiler
2026-11-10T17:35:10ZEric Roberts
2026-11-10T17:36:03Z
Fix Accounts.tsx for react-compiler
Eric Roberts
2026-11-10T17:26:31ZThe compiler mistakes reauth.usePassword() for a React hook:
Hooks must be called at the top level of a function component
or custom Hook
Added a reauthenticate helper to fix it.
Semantic diff summary
1 added,
3 modified,
0 signature changed,
0 removed
across 3 analyzed files
+0
-1
scripts/compiler.test.mjs
#
+3
-2
src/components/Accounts.tsx
#
| ... | ... | @@ -33,7 +33,7 @@ import { | |
| 33 | 33 | } from "@fortawesome/free-solid-svg-icons"; | |
| 34 | 34 | ||
| 35 | 35 | import { SettingsContext } from "./Settings"; | |
| 36 | - | import { useChats, readyServiceWorker } from "../util"; | |
| 36 | + | import { useChats, readyServiceWorker, reauthenticate } from "../util"; | |
| 37 | 37 | ||
| 38 | 38 | export const Accounts = () => { | |
| 39 | 39 | const { accounts, setAccounts, persistence, setSettings } = |
| ... | ... | @@ -321,7 +321,8 @@ export const Accounts = () => { | |
| 321 | 321 | id="reauth-form" | |
| 322 | 322 | onSubmit={(e) => { | |
| 323 | 323 | e.preventDefault(); | |
| 324 | - | reauth?.usePassword(e.currentTarget.password.value); | |
| 324 | + | if (reauth) | |
| 325 | + | reauthenticate(reauth, e.currentTarget.password.value); | |
| 325 | 326 | setStatus("connecting"); | |
| 326 | 327 | setReauth(undefined); | |
| 327 | 328 | }} |
+4
-0
src/util.ts
#
| ... | ... | @@ -11,6 +11,10 @@ export const loadEmojiData = async () => ({ | |
| 11 | 11 | ...(await import("@emoji-mart/data")), | |
| 12 | 12 | }); | |
| 13 | 13 | ||
| 14 | + | export function reauthenticate(client: borogove.Client, password: string) { | |
| 15 | + | client.usePassword(password); | |
| 16 | + | } | |
| 17 | + | ||
| 14 | 18 | export const ios = navigator.userAgent.match(/(iPad|iPhone|iPod)/g); | |
| 15 | 19 | export const webkit = | |
| 16 | 20 | navigator.userAgent.match(/AppleWebKit/) && |