Merge pull request #5615 from turt2live/travis/granular_bugs

Use SettingsStore to get the default theme
This commit is contained in:
Matthew Hodgson 2017-11-16 13:08:48 +00:00 committed by GitHub
commit 58f2e51af5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ import {parseQs, parseQsFromFragment} from './url_utils';
import Platform from './platform'; import Platform from './platform';
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore"; import SettingsStore, {SettingLevel} from "matrix-react-sdk/lib/settings/SettingsStore";
import Tinter from 'matrix-react-sdk/lib/Tinter'; import Tinter from 'matrix-react-sdk/lib/Tinter';
var lastLocationHashSet = null; var lastLocationHashSet = null;
@ -299,7 +299,7 @@ async function loadApp() {
// as quickly as we possibly can, set a default theme... // as quickly as we possibly can, set a default theme...
const styleElements = Object.create(null); const styleElements = Object.create(null);
let a; let a;
const theme = configJson.default_theme || 'light'; const theme = SettingsStore.getValueAt(SettingLevel.DEFAULT, "theme");
for (let i = 0; (a = document.getElementsByTagName("link")[i]); i++) { for (let i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
const href = a.getAttribute("href"); const href = a.getAttribute("href");
if (!href) continue; if (!href) continue;