mirror of
https://github.com/element-hq/element-web.git
synced 2024-11-30 23:31:28 +03:00
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.
This commit is contained in:
parent
a4b58f4d83
commit
58de839621
1 changed files with 6 additions and 2 deletions
|
@ -313,9 +313,13 @@ async function loadApp() {
|
|||
// FIXME: we should probably block loading the app or even
|
||||
// showing a spinner until the theme is loaded, to avoid
|
||||
// flashes of unstyled content.
|
||||
a.onload = () => {
|
||||
if (typeof InstallTrigger !== 'undefined') {
|
||||
Tinter.setTheme(theme);
|
||||
};
|
||||
} else {
|
||||
a.onload = () => {
|
||||
Tinter.setTheme(theme);
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Firefox requires this to not be done via `setAttribute`
|
||||
// or via HTML.
|
||||
|
|
Loading…
Reference in a new issue