diff options
| author | Adam Soltys <[email protected]> | 2026-11-12 23:35:08 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-12 23:35:08 -0700 |
| commit | 8d92028c0a4eeb19258e81156c5b9efc3c1d1f88 (patch) | |
| tree | adca345fe4d97e851c4b61c7a6dc0d1c96aa95d1 /src | |
| parent | 5dad3fed20be40eaaeb8e7373dd005f61b3e5c8b (diff) | |
| download | coinosv3-8d92028c0a4eeb19258e81156c5b9efc3c1d1f88.tar.gz coinosv3-8d92028c0a4eeb19258e81156c5b9efc3c1d1f88.zip | |
Leaving a group from its own screen no longer breaks the app. "Tried to leave but got this" (Adam, 2026-11-13): ReferenceError "Cannot access 'Q' before initialization" in the group screen. wnView declares `const wn = gClient(g)` for the group on screen, which shadows the module's wn for the whole function; the "groups still loading" test above it (`!wn || … || !ng || ngLoading`, widened for relay groups in 3197c70) ran when the group was gone — just left — and read the inner wn before it was set. The test now lives outside the function (groupClientsLoading). nip29-group-test leaves the dead-relay group from its own screen on the second device: "Something broke" without this, back to Messages with itHEADmaster
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index d5c7943..0573def 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -18299,11 +18299,16 @@ export function messagesFeature(ctx) { }) : null)); } + // Outside wnView: its own `const wn = gClient(g)` shadows the module's wn + // for the whole function, so a `!wn` in there read the inner one before + // it was set — a ReferenceError the moment a group was left from its own + // screen (Adam's phone, 2026-11-13). + const groupClientsLoading = () => !wn || wnLoading || !cd || cdLoading || !ng || ngLoading; function wnView() { const g = findGroup(ui.msgPeer); if (!g) { // the groups are still loading (a reload straight into this screen) - if (!wn || wnLoading || !cd || cdLoading || !ng || ngLoading) { Promise.all([whiteNoise(), cordnChat(), nip29Chat()]).then(() => scheduleRepaint()); return h('div', { class: 'card col chat-card chat-page' }, h('span', { class: 'spinner' })); } + if (groupClientsLoading()) { Promise.all([whiteNoise(), cordnChat(), nip29Chat()]).then(() => scheduleRepaint()); return h('div', { class: 'card col chat-card chat-page' }, h('span', { class: 'spinner' })); } ui.msgView = 'home'; return homeView(); } |
