fix(machine): fix TDZ error accessing isElectron before initialization
loadTheme() and loadColorMode() were called during module evaluation before the isElectron const was declared, causing a ReferenceError in Firefox's strict TDZ enforcement. Move isElectron above the ref() calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7a42380f0e
commit
c2880b187b
1 changed files with 2 additions and 2 deletions
|
|
@ -20,11 +20,11 @@ export const themes: ThemeOption[] = [
|
|||
const THEME_KEY = 'lamassu-theme'
|
||||
const MODE_KEY = 'lamassu-color-mode'
|
||||
|
||||
const isElectron = !!(window as unknown as Record<string, unknown>).electronAPI
|
||||
|
||||
const current = ref<ThemeId>(loadTheme())
|
||||
const colorMode = ref<ColorMode>(loadColorMode())
|
||||
|
||||
const isElectron = !!(window as unknown as Record<string, unknown>).electronAPI
|
||||
|
||||
function loadTheme(): ThemeId {
|
||||
try {
|
||||
const stored = localStorage.getItem(THEME_KEY)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue