Skip to content

Commit 5b32ecb

Browse files
authored
[Tinter.setTheme fix] add missing comment and move old to correct position
1 parent 58de839 commit 5b32ecb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/vector/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,19 @@ async function loadApp() {
310310
// in case the Tinter.tint() in MatrixChat fires before the
311311
// CSS has actually loaded (which in practice happens)...
312312

313-
// FIXME: we should probably block loading the app or even
314-
// showing a spinner until the theme is loaded, to avoid
315-
// flashes of unstyled content.
313+
// This if fixes Tinter.setTheme to not fire on Firefox
314+
// in case it is the first time loading Riot.
315+
// `InstallTrigger` is a Object which only exists on Firefox
316+
// (it is used for their Plugins) and can be used as a
317+
// feature check.
318+
// Firefox loads css always before js. This is why we dont use
319+
// onload or it's EventListener as thoose will never trigger.
316320
if (typeof InstallTrigger !== 'undefined') {
317321
Tinter.setTheme(theme);
318322
} else {
323+
// FIXME: we should probably block loading the app or even
324+
// showing a spinner until the theme is loaded, to avoid
325+
// flashes of unstyled content.
319326
a.onload = () => {
320327
Tinter.setTheme(theme);
321328
};

0 commit comments

Comments
 (0)