Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
4cello committed Mar 30, 2024
1 parent c00fd56 commit 5763bb5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
24 changes: 11 additions & 13 deletions src/components/TheSelectPrinterDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
bool: false,
hostname: '',
port: 7125,
name: ''
name: '',
}
private editPrinterValid = false
private dialogEditPrinter = {
bool: false,
id: '',
hostname: '',
port: 0,
name: ''
name: '',
}
/**
Expand Down Expand Up @@ -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 })
Expand All @@ -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,
Expand Down Expand Up @@ -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])
}
}
)
})
}
}
</script>
4 changes: 2 additions & 2 deletions src/components/settings/SettingsRemotePrintersTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand All @@ -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 })
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@
},
"RemotePrintersTab": {
"AddPrinter": "Add Printer",
"AdvancedSettings":"Advanced Settings",
"AdvancedSettings": "Advanced Settings",
"EditPrinter": "Edit Printer",
"Hostname": "Hostname",
"Name": "Name",
Expand Down
2 changes: 1 addition & 1 deletion src/store/gui/remoteprinters/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const actions: ActionTree<GuiRemoteprintersState, RootState> = {
id,
hostname: payload.values.hostname ?? '',
port: payload.values.port ?? 7125,
name: payload.values.name
name: payload.values.name,
},
{ root: true }
)
Expand Down

0 comments on commit 5763bb5

Please sign in to comment.