2019-04-10 13:58:11 +02:00
|
|
|
import General, { GeneralState } from './Settings/General'
|
|
|
|
import Timeline, { TimelineState } from './Settings/Timeline'
|
2019-04-04 16:52:08 +02:00
|
|
|
import { Module, MutationTree } from 'vuex'
|
2019-04-14 16:11:24 +02:00
|
|
|
import { RootState } from '@/store'
|
2019-04-04 16:52:08 +02:00
|
|
|
|
|
|
|
export interface SettingsState {
|
|
|
|
accountID: number | null
|
|
|
|
}
|
|
|
|
|
|
|
|
const state = (): SettingsState => ({
|
|
|
|
accountID: null
|
|
|
|
})
|
|
|
|
|
|
|
|
export const MUTATION_TYPES = {
|
|
|
|
CHANGE_ACCOUNT_ID: 'changeAccountID'
|
|
|
|
}
|
|
|
|
|
|
|
|
const mutations: MutationTree<SettingsState> = {
|
|
|
|
[MUTATION_TYPES.CHANGE_ACCOUNT_ID]: (state, id: number) => {
|
|
|
|
state.accountID = id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-10 13:58:11 +02:00
|
|
|
export interface SettingsModuleState extends SettingsState {
|
|
|
|
General: GeneralState,
|
|
|
|
Timeline: TimelineState,
|
|
|
|
}
|
|
|
|
|
2019-04-14 16:11:24 +02:00
|
|
|
const Settings: Module<SettingsState, RootState> = {
|
2019-04-04 16:52:08 +02:00
|
|
|
namespaced: true,
|
|
|
|
modules: {
|
|
|
|
General,
|
|
|
|
Timeline
|
|
|
|
},
|
|
|
|
state: state,
|
|
|
|
mutations: mutations
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Settings
|