fix: removing remote printer in remote mode (#676)

This commit is contained in:
Stefan Dej authored and GitHub committed 2022-02-26 09:01:15 +01:00
1 parent 87b0a8c7cb
commit c4e68594cd
1 file changed
+8 -2
+8 -2
View File
@@ -107,10 +107,16 @@ export const actions: ActionTree<GuiRemoteprintersState, RootState> = {
dispatch('upload', payload.id)
},
delete({ commit, dispatch }, id) {
delete({ commit, dispatch, rootState }, id) {
commit('delete', id)
dispatch('farm/unregisterPrinter', id, { root: true })
Vue.$socket.emit('server.database.delete_item', { namespace: 'mainsail', key: 'remoteprinters.printers.' + id })
if (rootState.socket?.remoteMode) dispatch('upload')
else {
Vue.$socket.emit('server.database.delete_item', {
namespace: 'mainsail',
key: 'remoteprinters.printers.' + id,
})
}
},
}