From 022e40a12751728347daef46829990c8f3573c56 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 15 Nov 2017 19:04:49 -0700 Subject: [PATCH] Use SettingsStore for default theme Signed-off-by: Travis Ralston --- src/components/structures/MatrixChat.js | 2 +- src/settings/SettingsStore.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 37005b0d69..05ed9c95ed 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -891,7 +891,7 @@ module.exports = React.createClass({ */ _onSetTheme: function(theme) { if (!theme) { - theme = this.props.config.default_theme || 'light'; + theme = SettingsStore.getValueAt(SettingLevel.DEFAULT, "theme"); } // look for the stylesheet elements. diff --git a/src/settings/SettingsStore.js b/src/settings/SettingsStore.js index b6343c4a96..dde1d3ca15 100644 --- a/src/settings/SettingsStore.js +++ b/src/settings/SettingsStore.js @@ -181,8 +181,8 @@ export default class SettingsStore { /** * Gets a setting's value at a particular level, ignoring all levels that are more specific. - * @param {"device"|"room-device"|"room-account"|"account"|"room"} level The level to - * look at. + * @param {"device"|"room-device"|"room-account"|"account"|"room"|"config"|"default"} level The + * level to look at. * @param {string} settingName The name of the setting to read. * @param {String} roomId The room ID to read the setting value in, may be null. * @param {boolean} explicit If true, this method will not consider other levels, just the one