support custom themes from setting
also move theme setting code from MatrixChat to own file.
This commit is contained in:
parent
79d4434c9f
commit
558f8daeeb
6 changed files with 151 additions and 107 deletions
|
@ -16,12 +16,13 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import SettingController from "./SettingController";
|
||||
import {DEFAULT_THEME, THEMES} from "../../themes";
|
||||
import {DEFAULT_THEME, enumerateThemes} from "../../theme";
|
||||
|
||||
export default class ThemeController extends SettingController {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
const themes = enumerateThemes();
|
||||
// Override in case some no longer supported theme is stored here
|
||||
if (!THEMES[calculatedValue]) {
|
||||
if (!themes[calculatedValue]) {
|
||||
return DEFAULT_THEME;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue