Commit 6f2843f
committed
fix: prevent permanent loading screen when navigating between pages
Two bugs in page content loading caused pages to show "Loading..." forever:
1. When readPageContent returned null (file doesn't exist on disk yet),
pageContents[id] was never set, so contentLoaded stayed false forever.
Fix: fall back to empty string when backend returns null.
2. The check `!pageContents[id]` treated empty string '' as falsy, causing
re-reads from backend on every navigation to pages with empty content.
Fix: use `!(id in pageContents)` for proper existence check.
Applied the fix in all three code paths: handlePageSelect, initial load,
and loadAndApplySpaceState (space switching).
https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM1 parent 57c033b commit 6f2843f
1 file changed
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
| 362 | + | |
362 | 363 | | |
363 | | - | |
364 | | - | |
365 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
366 | 367 | | |
367 | 368 | | |
368 | 369 | | |
| |||
0 commit comments