diff options
Diffstat (limited to 'src/modules/config.js')
| -rw-r--r-- | src/modules/config.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/modules/config.js b/src/modules/config.js index 8381fa53..47b24d77 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -1,10 +1,24 @@ import { set, delete as del } from 'vue' import { setPreset, applyTheme } from '../services/style_setter/style_setter.js' +import messages from '../i18n/messages' const browserLocale = (window.navigator.language || 'en').split('-')[0] +/* TODO this is a bit messy. + * We need to declare settings with their types and also deal with + * instance-default settings in some way, hopefully try to avoid copy-pasta + * in general. + */ +export const multiChoiceProperties = [ + 'postContentType', + 'subjectLineBehavior' +] + export const defaultState = { colors: {}, + theme: undefined, + customTheme: undefined, + customThemeSource: undefined, hideISP: false, // bad name: actually hides posts of muted USERS hideMutedPosts: undefined, // instance default @@ -31,7 +45,8 @@ export const defaultState = { likes: true, repeats: true, moves: true, - emojiReactions: false + emojiReactions: false, + followRequest: true }, webPushNotifications: false, muteWords: [], @@ -96,10 +111,15 @@ const config = { commit('setOption', { name, value }) switch (name) { case 'theme': - setPreset(value, commit) + setPreset(value) break case 'customTheme': - applyTheme(value, commit) + case 'customThemeSource': + applyTheme(value) + break + case 'interfaceLanguage': + messages.setLanguage(this.getters.i18n, value) + break } } } |
