diff --git a/src/components/panels/FarmPrinterPanel.vue b/src/components/panels/FarmPrinterPanel.vue index bcfb55959..44dc4c9f6 100644 --- a/src/components/panels/FarmPrinterPanel.vue +++ b/src/components/panels/FarmPrinterPanel.vue @@ -228,8 +228,14 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin, ThemeMixin, Webc } clickPrinter() { - if (this.printer.socket.isConnected) this.$store.dispatch('changePrinter', { printer: this.printer._namespace }) - else this.$store.dispatch('farm/' + this.printer._namespace + '/reconnect') + // If the printer is already connected, just switch to it + if (this.printer.socket.isConnected) { + this.$store.dispatch('changePrinter', { printer: this.printer._namespace }) + return + } + + // Otherwise, reconnect to the printer + this.$store.dispatch('farm/' + this.printer._namespace + '/reconnect') } mounted() { diff --git a/src/store/actions.ts b/src/store/actions.ts index ba07f8d86..05ddc62d7 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -19,6 +19,7 @@ export const actions: ActionTree = { dispatch('socket/setSocket', { hostname: printerSocket.hostname, port: printerSocket.port, + path: printerSocket.path, }) },