mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
4c4220e9dd
1 changed files with 8 additions and 4 deletions
|
@ -931,8 +931,15 @@ module.exports = React.createClass({
|
|||
Tinter.tint(colors[0], colors[1]);
|
||||
};
|
||||
|
||||
// turns out that Firefox preloads the CSS for link elements with
|
||||
// the disabled attribute, but Chrome doesn't.
|
||||
|
||||
let cssLoaded = false;
|
||||
|
||||
styleElements[theme].onload = () => {
|
||||
switchTheme();
|
||||
};
|
||||
|
||||
for (let i = 0; i < document.styleSheets.length; i++) {
|
||||
const ss = document.styleSheets[i];
|
||||
if (ss && ss.href === styleElements[theme].href) {
|
||||
|
@ -942,11 +949,8 @@ module.exports = React.createClass({
|
|||
}
|
||||
|
||||
if (cssLoaded) {
|
||||
styleElements[theme].onload = undefined;
|
||||
switchTheme();
|
||||
} else {
|
||||
styleElements[theme].onload = () => {
|
||||
switchTheme();
|
||||
};
|
||||
}
|
||||
|
||||
if (theme === 'dark') {
|
||||
|
|
Loading…
Reference in a new issue