refs #850 Replace Shortcut with typescript
This commit is contained in:
parent
ac21511236
commit
b9941e71c3
|
@ -4,7 +4,7 @@ import Jump, { JumpState } from './Modals/Jump'
|
|||
import ListMembership, { ListMembershipState } from './Modals/ListMembership'
|
||||
import AddListMember, { AddListMemberState } from './Modals/AddListMember'
|
||||
import MuteConfirm, { MuteConfirmState } from './Modals/MuteConfirm'
|
||||
import Shortcut from './Modals/Shortcut'
|
||||
import Shortcut, { ShortcutState } from './Modals/Shortcut'
|
||||
import Report, { ReportState } from './Modals/Report'
|
||||
import { Module, GetterTree } from 'vuex'
|
||||
import { RootState } from '@/store/index'
|
||||
|
@ -18,7 +18,8 @@ export interface ModalsModuleState extends ModalsState {
|
|||
ListMembership: ListMembershipState,
|
||||
MuteConfirm: MuteConfirmState,
|
||||
NewToot: NewTootModuleState,
|
||||
Report: ReportState
|
||||
Report: ReportState,
|
||||
Shortcut: ShortcutState
|
||||
}
|
||||
|
||||
const state = (): ModalsState => ({})
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
modalOpen: false
|
||||
},
|
||||
mutations: {
|
||||
changeModal (state, value) {
|
||||
state.modalOpen = value
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
import { Module, MutationTree } from 'vuex'
|
||||
import { RootState } from '@/store'
|
||||
|
||||
export interface ShortcutState {
|
||||
modalOpen: boolean
|
||||
}
|
||||
|
||||
const state = (): ShortcutState => ({
|
||||
modalOpen: false
|
||||
})
|
||||
|
||||
export const MUTATION_TYPES = {
|
||||
CHANGE_MODAL: 'changeModal'
|
||||
}
|
||||
|
||||
const mutations: MutationTree<ShortcutState> = {
|
||||
[MUTATION_TYPES.CHANGE_MODAL]: (state, value: boolean) => {
|
||||
state.modalOpen = value
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: state,
|
||||
mutations: mutations
|
||||
} as Module<ShortcutState, RootState>
|
Loading…
Reference in New Issue