Skip to content

Commit 58de839

Browse files
authored
Fix Tinter.setTheme to not fire using Firefox
This if checks if we got a Firefox using a variable that is undefined everywhere except in Firefox. In Firefox because of how it renders the DOM ensure that css is always loaded before it loads/runs the js code. Therefor onload 1. never triggers and 2. we can just call setTheme.
1 parent a4b58f4 commit 58de839

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vector/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,13 @@ async function loadApp() {
313313
// FIXME: we should probably block loading the app or even
314314
// showing a spinner until the theme is loaded, to avoid
315315
// flashes of unstyled content.
316-
a.onload = () => {
316+
if (typeof InstallTrigger !== 'undefined') {
317317
Tinter.setTheme(theme);
318-
};
318+
} else {
319+
a.onload = () => {
320+
Tinter.setTheme(theme);
321+
};
322+
}
319323
} else {
320324
// Firefox requires this to not be done via `setAttribute`
321325
// or via HTML.

0 commit comments

Comments
 (0)