refs #850 Replace Shortcut with typescript

This commit is contained in:
AkiraFukushima 2019-04-11 00:19:25 +09:00
parent ac21511236
commit b9941e71c3
3 changed files with 29 additions and 13 deletions

View File

@ -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 => ({})

View File

@ -1,11 +0,0 @@
export default {
namespaced: true,
state: {
modalOpen: false
},
mutations: {
changeModal (state, value) {
state.modalOpen = value
}
}
}

View File

@ -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>