From c4e68594cde599cda15657b45956c7f956da3ccd Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 26 Feb 2022 09:01:15 +0100 Subject: [PATCH] fix: removing remote printer in remote mode (#676) --- src/store/gui/remoteprinters/actions.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/store/gui/remoteprinters/actions.ts b/src/store/gui/remoteprinters/actions.ts index f0669e4d..e153851e 100644 --- a/src/store/gui/remoteprinters/actions.ts +++ b/src/store/gui/remoteprinters/actions.ts @@ -107,10 +107,16 @@ export const actions: ActionTree = { 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, + }) + } }, }