Commit 6248153
fix: defer chat badge autorun to avoid module-init TDZ crash
The badge autorun fired synchronously inside the ChatStore constructor,
which runs at module load. Auto-imported globals used in setBadge ->
getTotalCounters (U.Space) were not yet initialized in some module
evaluation orders, causing a "Cannot access 'tt' before initialization"
ReferenceError from MobX. Schedule the autorun via queueMicrotask so
all top-level module evaluation finishes first, while still binding
before any user interaction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 48db477 commit 6248153
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments