refactor: new order of init moonraker databases and printer
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
9cb63ee193
commit
c6934d751f
@ -10,8 +10,12 @@ export const actions: ActionTree<GuiState, RootState> = {
|
||||
commit('reset')
|
||||
},
|
||||
|
||||
init({ commit, dispatch, rootState }, payload) {
|
||||
init() {
|
||||
window.console.debug('init gui')
|
||||
Vue.$socket.emit('server.database.get_item', { namespace: 'mainsail' }, { action: 'gui/initStore'})
|
||||
},
|
||||
|
||||
initStore({ commit, dispatch, rootState }, payload) {
|
||||
|
||||
//added in V2.1
|
||||
if (
|
||||
@ -67,8 +71,6 @@ export const actions: ActionTree<GuiState, RootState> = {
|
||||
|
||||
// init remote printers, when remoteMode is off
|
||||
if (!rootState.socket?.remoteMode) dispatch('farm/readStoredPrinters', {}, { root: true })
|
||||
|
||||
dispatch('printer/init', null, { root: true })
|
||||
},
|
||||
|
||||
saveSetting({ commit }, payload) {
|
||||
|
@ -23,15 +23,11 @@ export const actions: ActionTree<ServerState, RootState> = {
|
||||
},
|
||||
|
||||
checkDatabases({ dispatch }, payload) {
|
||||
if (payload.namespaces?.includes('mainsail'))
|
||||
Vue.$socket.emit('server.database.get_item', { namespace: 'mainsail' }, { action: 'gui/init'})
|
||||
else {
|
||||
Vue.$socket.emit('server.database.post_item', { namespace: 'mainsail', key: 'init', value: true })
|
||||
dispatch('printer/init', null, { root: true })
|
||||
}
|
||||
|
||||
if (payload.namespaces?.includes('mainsail')) dispatch('gui/init', null, { root: true })
|
||||
if (payload.namespaces?.includes('webcams')) dispatch('gui/webcams/init', null, { root: true })
|
||||
if (payload.namespaces?.includes('mainsail_presets')) dispatch('gui/presets/init', null, { root: true })
|
||||
|
||||
dispatch('printer/init', null, { root: true })
|
||||
},
|
||||
|
||||
initServerInfo: function ({ dispatch, commit }, payload) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user