2019-04-10 13:58:11 +02:00
|
|
|
import General, { GeneralState } from './Settings/General'
|
|
|
|
import Timeline, { TimelineState } from './Settings/Timeline'
|
2021-05-09 17:49:24 +02:00
|
|
|
import Filters, { FiltersModuleState } from './Settings/Filters'
|
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
|
|
|
|
2019-06-06 16:44:50 +02:00
|
|
|
export type SettingsState = {
|
2019-05-27 15:56:54 +02:00
|
|
|
accountID: string | null
|
2019-04-04 16:52:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const state = (): SettingsState => ({
|
|
|
|
accountID: null
|
|
|
|
})
|
|
|
|
|
|
|
|
export const MUTATION_TYPES = {
|
|
|
|
CHANGE_ACCOUNT_ID: 'changeAccountID'
|
|
|
|
}
|
|
|
|
|
|
|
|
const mutations: MutationTree<SettingsState> = {
|
2019-05-27 15:56:54 +02:00
|
|
|
[MUTATION_TYPES.CHANGE_ACCOUNT_ID]: (state, id: string) => {
|
2019-04-04 16:52:08 +02:00
|
|
|
state.accountID = id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-06 16:44:50 +02:00
|
|
|
type SettingsModule = {
|
2019-05-27 15:56:54 +02:00
|
|
|
General: GeneralState
|
|
|
|
Timeline: TimelineState
|
2021-05-09 17:49:24 +02:00
|
|
|
Filter: FiltersModuleState
|
2019-04-10 13:58:11 +02:00
|
|
|
}
|
|
|
|
|
2019-06-06 16:44:50 +02:00
|
|
|
export type SettingsModuleState = SettingsModule & SettingsState
|
|
|
|
|
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,
|
2021-05-08 13:59:59 +02:00
|
|
|
Timeline,
|
|
|
|
Filters
|
2019-04-04 16:52:08 +02:00
|
|
|
},
|
|
|
|
state: state,
|
|
|
|
mutations: mutations
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Settings
|