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, + }) + } }, }