fix: apply initial DOM state from preferences store on load (no-flash in browser dev mode)
This commit is contained in:
@@ -100,6 +100,12 @@ function persistToSQLite(prefs) {
|
|||||||
|
|
||||||
let preferences = $state(readFromDOM());
|
let preferences = $state(readFromDOM());
|
||||||
|
|
||||||
|
// Ensure data-theme and zone attributes are always present on the DOM, even
|
||||||
|
// when there is no Tauri webview injection script (e.g. browser dev mode).
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
applyToDOM(preferences);
|
||||||
|
}
|
||||||
|
|
||||||
export function getPreferences() {
|
export function getPreferences() {
|
||||||
return preferences;
|
return preferences;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user