more refactoring
This commit is contained in:
parent
2db991fc7f
commit
82fa5d08c4
11 changed files with 109 additions and 76 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue