This commit is contained in:
Matthew Hodgson 2017-10-23 00:56:15 +01:00
parent 37fd19290f
commit f09fbccc19
5 changed files with 117 additions and 13 deletions

View file

@ -180,6 +180,21 @@ export default {
});
},
getTheme: function() {
let syncedSettings;
let theme;
if (MatrixClientPeg.get()) {
syncedSettings = this.getSyncedSettings();
}
if (!syncedSettings || !syncedSettings.theme) {
theme = SdkConfig.get().default_theme || 'light';
}
else {
theme = syncedSettings.theme;
}
return theme;
},
getSyncedSettings: function() {
const event = MatrixClientPeg.get().getAccountData('im.vector.web.settings');
return event ? event.getContent() : {};