From 5763bb58961b41f07e0370aece4feeb8ec7579d6 Mon Sep 17 00:00:00 2001 From: 4cello Date: Sat, 30 Mar 2024 11:14:04 +0100 Subject: [PATCH] Formatting --- src/components/TheSelectPrinterDialog.vue | 24 +++++++++---------- .../settings/SettingsRemotePrintersTab.vue | 4 ++-- src/locales/en.json | 2 +- src/store/gui/remoteprinters/actions.ts | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/components/TheSelectPrinterDialog.vue b/src/components/TheSelectPrinterDialog.vue index 240d3a762..7e41977d2 100644 --- a/src/components/TheSelectPrinterDialog.vue +++ b/src/components/TheSelectPrinterDialog.vue @@ -268,7 +268,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) { bool: false, hostname: '', port: 7125, - name: '' + name: '', } private editPrinterValid = false private dialogEditPrinter = { @@ -276,7 +276,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) { id: '', hostname: '', port: 0, - name: '' + name: '', } /** @@ -381,7 +381,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) { const values = { hostname: this.dialogAddPrinter.hostname, port: this.dialogAddPrinter.port, - name: this.dialogAddPrinter.name + name: this.dialogAddPrinter.name, } this.$store.dispatch('gui/remoteprinters/store', { values }) @@ -402,7 +402,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) { const values = { hostname: this.dialogEditPrinter.hostname, port: this.dialogEditPrinter.port, - name: this.dialogEditPrinter.name + name: this.dialogEditPrinter.name, } this.$store.dispatch('gui/remoteprinters/update', { id: this.dialogEditPrinter.id, @@ -444,17 +444,15 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) { } mounted() { - this.$store.dispatch('gui/remoteprinters/initFromLocalstorage').then( - () => { - window.console.log({printers: this.printers, gui: this.guiIsReady}) - if ("printer" in this.$route.query) { - let matching = this.printers.filter((printer) => printer.name === this.$route.query.printer) - if (matching.length > 0) { - this.connect(matching[0]) - } + this.$store.dispatch('gui/remoteprinters/initFromLocalstorage').then(() => { + window.console.log({ printers: this.printers, gui: this.guiIsReady }) + if ('printer' in this.$route.query) { + let matching = this.printers.filter((printer) => printer.name === this.$route.query.printer) + if (matching.length > 0) { + this.connect(matching[0]) } } - ) + }) } } diff --git a/src/components/settings/SettingsRemotePrintersTab.vue b/src/components/settings/SettingsRemotePrintersTab.vue index 59d2aede5..528bb2019 100644 --- a/src/components/settings/SettingsRemotePrintersTab.vue +++ b/src/components/settings/SettingsRemotePrintersTab.vue @@ -157,7 +157,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) { const printer = { hostname: this.form.hostname, port: this.form.port, - name: this.form.name + name: this.form.name, } this.$store.dispatch('gui/remoteprinters/store', { values: printer }) @@ -181,7 +181,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) { const values = { hostname: this.form.hostname, port: this.form.port, - name: this.form.name + name: this.form.name, } this.$store.dispatch('gui/remoteprinters/update', { id: this.form.id, values }) diff --git a/src/locales/en.json b/src/locales/en.json index 0c31360d5..210a1afd7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1062,7 +1062,7 @@ }, "RemotePrintersTab": { "AddPrinter": "Add Printer", - "AdvancedSettings":"Advanced Settings", + "AdvancedSettings": "Advanced Settings", "EditPrinter": "Edit Printer", "Hostname": "Hostname", "Name": "Name", diff --git a/src/store/gui/remoteprinters/actions.ts b/src/store/gui/remoteprinters/actions.ts index 9cc9c184b..b0b06842c 100644 --- a/src/store/gui/remoteprinters/actions.ts +++ b/src/store/gui/remoteprinters/actions.ts @@ -85,7 +85,7 @@ export const actions: ActionTree = { id, hostname: payload.values.hostname ?? '', port: payload.values.port ?? 7125, - name: payload.values.name + name: payload.values.name, }, { root: true } )