diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/instance.js | 47 | ||||
| -rw-r--r-- | src/modules/interface.js | 21 |
2 files changed, 49 insertions, 19 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js new file mode 100644 index 00000000..228cee4c --- /dev/null +++ b/src/modules/instance.js @@ -0,0 +1,47 @@ +import { set } from 'vue' + +const defaultState = { + name: 'Pleroma FE', + registrationOpen: true, + textlimit: 5000, + server: 'http://localhost:4040/', + theme: 'pleroma-dark', + background: 'img.png', + logo: '/static/logo.png', + logoMask: true, + logoMargin: '.2em', + redirectRootNoLogin: '/main/all', + redirectRootLogin: '/main/friends', + showInstanceSpecificPanel: false, + scopeOptionsEnabled: true, + formattingOptionsEnabled: false, + collapseMessageWithSubject: false, + disableChat: false, + // Nasty stuff + pleromaBackend: true, + customEmoji: [], + // Html stuff + instanceSpecificPanelContent: '', + tos: '' +} + +const instance = { + state: defaultState, + mutations: { + setInstanceOption (state, { name, value }) { + set(state, name, value) + } + }, + actions: { + setInstanceOption ({ commit, dispatch }, { name, value }) { + commit('setInstanceOption', {name, value}) + switch (name) { + case 'name': + dispatch('setPageTitle') + break + } + } + } +} + +export default instance diff --git a/src/modules/interface.js b/src/modules/interface.js index 0067ee64..07489685 100644 --- a/src/modules/interface.js +++ b/src/modules/interface.js @@ -1,10 +1,6 @@ import { set, delete as del } from 'vue' const defaultState = { - name: 'Pleroma FE', - registrationOpen: true, - textlimit: 5000, - server: 'http://localhost:4040/', settings: { currentSaveStateNotice: null, noticeClearTimeout: null @@ -14,11 +10,6 @@ const defaultState = { const interfaceMod = { state: defaultState, mutations: { - setInstanceOption (state, { name, value }) { - console.log(state) - console.log(name) - set(state, name, value) - }, settingsSaved (state, { success, error }) { if (success) { if (state.noticeClearTimeout) { @@ -33,19 +24,11 @@ const interfaceMod = { } }, actions: { - setPageTitle ({state}, option = '') { - document.title = `${option} ${state.name}` + setPageTitle ({ rootState }, option = '') { + document.title = `${option} ${rootState.instance.name}` }, settingsSaved ({ commit, dispatch }, { success, error }) { commit('settingsSaved', { success, error }) - }, - setInstanceOption ({ commit, dispatch }, { name, value }) { - commit('setInstanceOption', {name, value}) - switch (name) { - case 'name': - dispatch('setPageTitle') - break - } } } } |
