mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
turns out i made up the .complete property on link elements
This commit is contained in:
parent
8d6e3dd27d
commit
1fd7ac30e4
2 changed files with 12 additions and 2 deletions
|
@ -217,7 +217,7 @@ class Tinter {
|
|||
// cache our fixups
|
||||
if (this.cssFixups[this.theme]) return;
|
||||
|
||||
if (DEBUG) console.trace("calcCssFixups start for " + this.theme + " (checking " +
|
||||
if (DEBUG) console.debug("calcCssFixups start for " + this.theme + " (checking " +
|
||||
document.styleSheets.length +
|
||||
" stylesheets)");
|
||||
|
||||
|
|
|
@ -931,7 +931,17 @@ module.exports = React.createClass({
|
|||
Tinter.tint(colors[0], colors[1]);
|
||||
};
|
||||
|
||||
if (styleElements[theme].complete) {
|
||||
let cssLoaded = false;
|
||||
|
||||
for (let i = 0; i < document.styleSheets.length; i++) {
|
||||
const ss = document.styleSheets[i];
|
||||
if (ss && ss.href === styleElements[theme].href) {
|
||||
cssLoaded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cssLoaded) {
|
||||
switchTheme();
|
||||
} else {
|
||||
styleElements[theme].onload = () => {
|
||||
|
|
Loading…
Reference in a new issue