Stefan Dej f2a33a8e48
fix: recover gcode viewer after switching tabs
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-12-24 00:35:04 +01:00

25 lines
609 B
TypeScript

import { GcodeviewerState } from '@/store/gcodeviewer/types'
import { Module } from 'vuex'
import { actions } from '@/store/gcodeviewer/actions'
import { mutations } from '@/store/gcodeviewer/mutations'
import { getters } from '@/store/gcodeviewer/getters'
export const getDefaultState = (): GcodeviewerState => {
return {
viewerBackup: null,
canvasBackup: null,
loadedFileBackup: null
}
}
// initial state
const state = getDefaultState()
export const gcodeviewer: Module<GcodeviewerState, any> = {
namespaced: true,
state,
getters,
actions,
mutations
}