Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b8bebf0
refactor: rework the server init process to display current step
meteyou Dec 7, 2025
d4b1679
refactor: add strict typing for emitAndWait RPC methods
meteyou Dec 7, 2025
67042c3
refactor: remove unused file
meteyou Dec 7, 2025
e224c98
refactor: fix description in the MoonrakerRPCInterface.ts
meteyou Dec 7, 2025
1e7894b
Merge branch 'refactor/add-moonraker-types-emitAndWait' into refactor…
meteyou Dec 7, 2025
853c557
refactor: refactor init server process
meteyou Dec 7, 2025
caef34a
Merge remote-tracking branch 'upstream/develop' into refactor/add-moo…
meteyou Dec 21, 2025
cf34910
Merge branch 'refactor/add-moonraker-types-emitAndWait' into refactor…
meteyou Dec 21, 2025
ffd9992
refactor: split all files in smaller parts for better overview like t…
meteyou Dec 21, 2025
ef3ff17
refactor: remove reexports in types/moonraker/index
meteyou Dec 21, 2025
da56660
Merge branch 'refactor/add-moonraker-types-emitAndWait' into refactor…
meteyou Dec 21, 2025
1d3b630
refactor: update from emitAndWait commit and create new splited type …
meteyou Dec 21, 2025
cfc95b5
refactor: simplify error handling in TheConnectingDialog component
meteyou Dec 21, 2025
cddea23
Merge branch 'develop' into refactor/add-moonraker-types-emitAndWait
meteyou Jan 9, 2026
d174b20
Merge branch 'refactor/add-moonraker-types-emitAndWait' into refactor…
meteyou Jan 10, 2026
95650e0
refactor: enhance error handling and type definitions for JSON-RPC re…
meteyou Jan 10, 2026
ab81a0e
refactor: streamline server initialization and enhance data handling
meteyou Jan 10, 2026
18d7117
Merge remote-tracking branch 'upstream/develop' into refactor/add-moo…
meteyou Jan 16, 2026
bb0b766
Merge branch 'refactor/add-moonraker-types-emitAndWait' into refactor…
meteyou Jan 16, 2026
5d01568
refactor(server): simplify Klipper connection polling logic
meteyou Jan 17, 2026
1d5c79f
refactor(server): add log method
meteyou Jan 17, 2026
131e89f
refactor(server): streamline GCode store initialization and filtering
meteyou Jan 17, 2026
ab5aea8
refactor(actions): optimize root directory addition logic
meteyou Jan 17, 2026
8d97c8f
refactor(server): simplify server component initialization logic
meteyou Jan 17, 2026
a5bf0d2
refactor(printer): remove unnecessary webhook handling in payload pro…
meteyou Jan 17, 2026
79cabd0
refactor(server): enhance GCode event handling and filtering logic
meteyou Jan 17, 2026
9e417f0
Merge remote-tracking branch 'upstream/develop' into refactor/init-se…
meteyou Jan 18, 2026
df06c06
locale: remove unused key
meteyou Jan 18, 2026
e2e0042
refactor: add TODO comments to remove old init after finishing process
meteyou Jan 18, 2026
16df994
refactor: add TODO comments to remove old init components after async…
meteyou Jan 18, 2026
42e75cc
refactor: replace camelize with convertName for component initialization
meteyou Jan 18, 2026
03f023b
refactor: update initialization steps for server components and enhan…
meteyou Jan 18, 2026
1bb6ee1
refactor: remove unused MoonrakerApiIdentifyResponse interface from t…
meteyou Jan 18, 2026
436ac29
refactor: add early return for empty component initialization
meteyou Jan 18, 2026
acb93e2
refactor: update translations for Power module
meteyou Jan 18, 2026
a338718
refactor: optimize loop for component initialization
meteyou Jan 18, 2026
0bc39d7
fix: remove not existing root parameter in server.database.list
meteyou Jan 19, 2026
bc4893b
fix: complete PrinterRPC interface with all Moonraker methods
meteyou Jan 19, 2026
66852d1
fix: complete MachineRPC interface with all Moonraker methods
meteyou Jan 19, 2026
86b61f3
fix: complete ServerRPC interface with all Moonraker methods
meteyou Jan 19, 2026
1641c1b
fix: add nl at the end of .i18nignore
meteyou Jan 19, 2026
515c79a
fix: fix type issue in server/action.ts
meteyou Jan 19, 2026
e3786ee
fix: add klippy_state === shutdown fix/edgecase
meteyou Jan 20, 2026
534dc8b
fix: add timeout to emitAndWait to fix issues with printer.info
meteyou Jan 21, 2026
6724d60
refactor: remove unused import from PrinterRPC
meteyou Jan 21, 2026
1333a54
fix: fix timout and poll in server/action
meteyou Jan 22, 2026
0e33b0d
fix: add GcodeStore to initialization dialog/output and localization
meteyou Jan 23, 2026
c9c0384
wip: refactor gui store initialization and database handling
meteyou Jan 23, 2026
40c2b9d
fix: improve error message URL encoding in TheConnectingDialog
meteyou Jan 24, 2026
a0a4463
locale(de): add GcodeStore localization to German translation
meteyou Jan 24, 2026
6da8f22
Merge branch 'develop' into refactor/init-server-process
meteyou Jan 31, 2026
bdcb463
Merge branch 'develop' into refactor/init-server-process
meteyou Feb 1, 2026
d62e251
fix: fix missing type connection_id
meteyou Feb 1, 2026
b366a0c
fix: update polling logic to handle timer state correctly
meteyou Feb 1, 2026
40ee058
fix: correct progress calculation in component initialization
meteyou Feb 1, 2026
6828769
fix: set console_cleared_this_session property to server state
meteyou Feb 1, 2026
0a71fd6
Merge branch 'refactor/init-server-process' into refactor/init-gui-store
meteyou Feb 1, 2026
ccdea6e
refactor: streamline Gcodefiles metadata handling and improve visibil…
meteyou Feb 1, 2026
3a3ef67
refactor: enhance GUI initialization logic and update state management
meteyou Feb 1, 2026
9fa9bb7
refactor: remove deprecated webcam handling and update state management
meteyou Feb 1, 2026
561a063
refactor: remove unused setTempchartDatasetAdditionalSensorSetting ac…
meteyou Feb 1, 2026
8064233
refactor: update saveSetting action to use async/await for socket emi…
meteyou Feb 1, 2026
364f8a6
refactor: remove setHistoryColumns action and simplify column visibil…
meteyou Feb 1, 2026
9dabed7
refactor: simplify status visibility handling in history list and upd…
meteyou Feb 1, 2026
dc5dbdf
refactor: implement toggleArrayItem helper and simplify column visibi…
meteyou Feb 1, 2026
0fde1b0
refactor: streamline column visibility handling and remove redundant …
meteyou Feb 1, 2026
db33ce8
refactor: enhance panel expand handling and introduce GuiViewport type
meteyou Feb 1, 2026
1d8fb25
refactor: optimize deepSet function to use Vue.set for state updates
meteyou Feb 1, 2026
acb8f49
refactor: consolidate chart data handling and rename related functions
meteyou Feb 1, 2026
81553a0
refactor: add HistoryRPC interface for job history management
meteyou Feb 1, 2026
b96fe47
refactor: update resetMoonrakerDB to use socket RPC for database oper…
meteyou Feb 1, 2026
374083f
refactor: enhance groupDelete action to use async socket operations a…
meteyou Feb 1, 2026
fbf2be1
refactor: remove unused heater chart visibility and dashboard layout …
meteyou Feb 1, 2026
8eeb5a6
refactor: optimize restoreMoonrakerDB to use socket RPC for database …
meteyou Feb 1, 2026
2c7700c
refactor: optimize restoreMoonrakerDB to use socket RPC for database …
meteyou Feb 1, 2026
a3c1e59
refactor: simplify resetMoonrakerDB by using gui/getDefaults for defa…
meteyou Feb 1, 2026
2d49d9e
Merge branch 'develop' into refactor/init-gui-store
meteyou Feb 2, 2026
7748d41
refactor: rework the gui/heightmap store
meteyou Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/.i18nignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,18 @@ $t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart')
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop')
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostReboot')
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostShutdown')
$t('Editor.Uploading')
$t('ConnectionDialog.InitComponents.Announcements')
$t('ConnectionDialog.InitComponents.Database')
$t('ConnectionDialog.InitComponents.GcodeStore')
$t('ConnectionDialog.InitComponents.History')
$t('ConnectionDialog.InitComponents.JobQueue')
$t('ConnectionDialog.InitComponents.Power')
$t('ConnectionDialog.InitComponents.ProcStats')
$t('ConnectionDialog.InitComponents.Sensor')
$t('ConnectionDialog.InitComponents.ServerConfig')
$t('ConnectionDialog.InitComponents.ServerInfo')
$t('ConnectionDialog.InitComponents.Spoolman')
$t('ConnectionDialog.InitComponents.SystemInfo')
$t('ConnectionDialog.InitComponents.Timelapse')
$t('ConnectionDialog.InitComponents.UpdateManager')
$t('Editor.Uploading')
57 changes: 46 additions & 11 deletions src/components/TheConnectingDialog.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<template>
<v-dialog v-model="showDialog" persistent :width="400">
<panel :title="titleText" :icon="mdiConnection" card-class="the-connection-dialog" :margin-bottom="false">
<v-card-text v-if="connectingFailed" class="pt-5">
<v-card-text v-if="connectingFailed || initializationError" class="pt-5">
<connection-status :moonraker="false" />
<p class="text-center mt-3 mb-0">
{{ $t('ConnectionDialog.CannotConnectTo', { host: formatHostname }) }}
</p>
<p v-if="connectionFailedMessage" class="text-center mt-1 red--text">
{{ $t('ConnectionDialog.ErrorMessage', { message: connectionFailedMessage }) }}
</p>
<p class="text-center mt-3 mb-0">{{ errorMessageNeutral }}</p>
<p v-if="errorMessageRed" class="text-center mt-1 red--text">{{ errorMessageRed }}</p>
<template v-if="counter > 2">
<v-divider class="my-3" />
<p>{{ $t('ConnectionDialog.CheckMoonrakerLog') }}</p>
Expand All @@ -26,7 +22,13 @@
</div>
</v-card-text>
<v-card-text v-else class="pt-5">
<v-progress-linear :color="progressBarColor" indeterminate />
<v-progress-linear
:color="progressBarColor"
:indeterminate="initializationProgress === null"
:value="initializationProgress ?? 0" />
<p v-if="initializationStepText" class="text-center mt-3 mb-0 text--secondary">
{{ initializationStepText }}
</p>
</v-card-text>
</panel>
</v-dialog>
Expand Down Expand Up @@ -82,8 +84,21 @@ export default class TheConnectingDialog extends Mixins(BaseMixin, ThemeMixin) {
return true
}

get initializationProgress(): number | null {
return this.$store.state.socket.initializationProgress
}

get initializationError(): string | null {
return this.$store.state.socket.initializationError
}

get initializationStepText(): string | null {
return this.$store.state.socket.initializationStep
}

get titleText() {
if (this.connectingFailed) return this.$t('ConnectionDialog.Failed', { host: this.formatHostname })
if (this.connectingFailed || this.initializationError)
return this.$t('ConnectionDialog.Failed', { host: this.formatHostname })
if (this.isConnecting) return this.$t('ConnectionDialog.Connecting', { host: this.formatHostname })
if (!this.guiIsReady) return this.$t('ConnectionDialog.Initializing')

Expand All @@ -94,15 +109,35 @@ export default class TheConnectingDialog extends Mixins(BaseMixin, ThemeMixin) {
return this.$store.state.socket.connectionFailedMessage ?? null
}

get errorMessageNeutral() {
if (this.initializationError) return this.$t('ConnectionDialog.InitializationFailed')

return this.$t('ConnectionDialog.CannotConnectTo', { host: this.formatHostname })
}

get errorMessageRed() {
if (this.initializationError)
return this.$t('ConnectionDialog.ErrorMessage', { message: this.initializationError })

if (this.connectionFailedMessage)
return this.$t('ConnectionDialog.ErrorMessage', { message: this.connectionFailedMessage })

return null
}

get helpButtonUrl() {
if (!this.$store.state.socket.connectionFailedMessage) return null
if (!this.$store.state.socket.connectionFailedMessage && !this.initializationError) return null

return `https://docs.mainsail.xyz/faq/mainsail_errors/connection-${this.connectionFailedMessage?.toLowerCase()}`
const message = this.initializationError ?? this.connectionFailedMessage
if (!message) return null
const slug = encodeURIComponent(message.toLowerCase())
return `https://docs.mainsail.xyz/faq/mainsail_errors/connection-${slug}`
}

reconnect() {
this.counter++
this.$store.dispatch('socket/setData', { connectingFailed: false })
this.$store.dispatch('socket/resetInitialization')
this.$socket.connect()
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/components/mixins/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import Component from 'vue-class-component'
import { DateTimeFormatOptions } from 'vue-i18n'
import { ServerPowerStateDevice } from '@/store/server/power/types'
import { GuiViewport } from '@/store/gui/types'

@Component
export default class BaseMixin extends Vue {
Expand All @@ -26,7 +27,12 @@ export default class BaseMixin extends Vue {
}

get guiIsReady() {
return this.$store.state.socket.initializationList.length === 0
return (
this.$store.state.socket.initializationStep === null &&
this.$store.state.socket.initializationError === null &&
// TODO: remove after converting to async init server components
this.$store.state.socket.initializationList.length === 0
)
}

get klippyIsConnected(): boolean {
Expand Down Expand Up @@ -111,11 +117,12 @@ export default class BaseMixin extends Vue {
return this.$vuetify.breakpoint.xl
}

get viewport() {
get viewport(): GuiViewport {
if (this.isMobile) return 'mobile'
else if (this.isTablet) return 'tablet'
else if (this.isDesktop) return 'desktop'
else return 'widescreen'

return 'widescreen'
}

get isTouchDevice() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mixins/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class HistoryMixin extends Vue {
}

get moonrakerHistoryFields() {
const config = this.$store.state.server.config?.config ?? {}
const config = this.$store.state.server.config ?? {}
const sensors = Object.keys(config).filter((key) => key.startsWith('sensor '))
const historyFields: { desc: string; unit: string; provider: string; name: string; parameter: string }[] = []

Expand Down
4 changes: 2 additions & 2 deletions src/components/mixins/webcam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default class WebcamMixin extends Mixins(BaseMixin) {

if (baseUrl.startsWith('/webcam')) {
const ports = [80]
ports.push(this.$store.state.server.config?.config?.server?.port ?? 7125)
ports.push(this.$store.state.server.config?.config?.server?.ssl_port ?? 7130)
ports.push(this.$store.getters['server/getConfigValue']('server', 'port', 7125))
ports.push(this.$store.getters['server/getConfigValue']('server', 'ssl_port', 7130))

if (!ports.includes(this.hostPort)) url.port = this.hostPort.toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<v-col class="col-auto pl-0">
<v-icon
:color="header.visible ? 'primary' : 'grey lighten-1'"
@click.stop="changeMetadataVisible(header.value, !header.visible)">
@click.stop="changeMetadataVisible(header.value)">
{{ header.visible ? mdiCheckboxMarked : mdiCheckboxBlankOutline }}
</v-icon>
</v-col>
Expand All @@ -73,8 +73,14 @@ export default class GcodefilesPanelHeaderSettings extends Mixins(BaseMixin, Gco
mdiCog = mdiCog
mdiDragVertical = mdiDragVertical

changeMetadataVisible(name: string, value: boolean) {
this.$store.dispatch('gui/setGcodefilesMetadata', { name: name, value: value })
changeMetadataVisible(name: string) {
const value = [...(this.$store.state.gui.view.gcodefiles.hideMetadataColumns ?? [])]
const index = value.findIndex((value: string) => value === name)

if (index !== -1) value.splice(index, 1)
else value.push(name)

this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.hideMetadataColumns', value })
}
}
</script>
Expand Down
20 changes: 8 additions & 12 deletions src/components/panels/HistoryListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
hide-details
:input-value="status.showInTable"
:label="`${status.displayName} (${status.value})`"
@change="changeStatusVisible(status)" />
@change="changeStatusVisible(status.name)" />
</v-list-item>
<v-divider />
</template>
Expand Down Expand Up @@ -172,7 +172,7 @@
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { HistoryListPanelCol, HistoryListRowJob, ServerHistoryStateJob } from '@/store/server/history/types'
import { caseInsensitiveSort, formatFilesize } from '@/plugins/helpers'
import { caseInsensitiveSort, formatFilesize, toggleArrayItem } from '@/plugins/helpers'
import Panel from '@/components/ui/Panel.vue'
import {
mdiCloseThick,
Expand Down Expand Up @@ -452,10 +452,6 @@ export default class HistoryListPanel extends Mixins(BaseMixin, HistoryMixin, Hi
return this.$store.state.gui.view.history.hideColums ?? []
}

set hideColums(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'view.history.hideColums', value: newVal })
}

get showMaintenanceEntries() {
return this.$store.state.gui.view.history.showMaintenanceEntries
}
Expand Down Expand Up @@ -525,15 +521,15 @@ export default class HistoryListPanel extends Mixins(BaseMixin, HistoryMixin, Hi
}

changeColumnVisible(name: string) {
if (this.headers.filter((header) => header.value === name).length) {
let value = this.headers.filter((header) => header.value === name)[0].visible
const value = toggleArrayItem(this.hideColums, name)

this.$store.dispatch('gui/setHistoryColumns', { name: name, value: value })
}
this.$store.dispatch('gui/saveSetting', { name: 'view.history.hideColums', value })
}

changeStatusVisible(status: any) {
this.$store.dispatch('gui/toggleStatusInHistoryList', status.name)
changeStatusVisible(status: string) {
const value = toggleArrayItem(this.$store.state.gui.view.history.hidePrintStatus, status)

this.$store.dispatch('gui/saveSetting', { name: 'view.history.hidePrintStatus', value })
}

exportHistory() {
Expand Down
6 changes: 1 addition & 5 deletions src/components/panels/Miscellaneous/MoonrakerSensorValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ export default class MoonrakerSensorValue extends Mixins(BaseMixin) {
}

get sensorConfig() {
const name = `sensor ${this.sensor}`
const serverConfig = this.$store.state.server.config?.config ?? {}
if (!(name in serverConfig)) return {}

return serverConfig[name]
return this.$store.getters['server/getConfigSection'](`sensor ${this.sensor}`, {})
}

get parameterConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class TemperaturePanelListItemAdditionalSensorValue extends Mixin
}

get guiSetting() {
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
return this.$store.getters['gui/getChartDataAdditionalSensorValue']({
name: this.objectName,
sensor: this.keyName,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ export default class TemperaturePanelListItemEdit extends Mixins(BaseMixin) {
setChartColor(value: string | any): void {
if (typeof value === 'object' && 'hex' in value) value = value.hex

this.$store.dispatch('gui/setChartColor', {
this.$store.dispatch('gui/setChartData', {
objectName: this.objectName,
dataset: 'color',
value,
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export default class TemperaturePanelListItemEditAdditionalSensor extends Mixins
@Prop({ type: String, required: true }) readonly additionalSensor!: string

get value() {
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
return this.$store.getters['gui/getChartDataAdditionalSensorValue']({
name: this.objectName,
type: this.additionalSensor,
sensor: this.additionalSensor,
})
}

set value(newVal) {
this.$store.dispatch('gui/setDatasetAdditionalSensorStatus', {
this.$store.dispatch('gui/setChartDataAdditionalSensorStatus', {
objectName: this.objectName,
dataset: this.additionalSensor,
value: newVal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class TemperaturePanelListItemEditChartSerie extends Mixins(BaseM
}

set value(newVal) {
this.$store.dispatch('gui/setChartDatasetStatus', {
this.$store.dispatch('gui/setChartData', {
objectName: this.objectName,
dataset: this.serieName,
value: newVal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default class TemperaturePanelListItemNevermoreValue extends Mixins(BaseM
}

get guiSetting() {
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
return this.$store.getters['gui/getChartDataAdditionalSensorValue']({
name: this.objectName,
sensor: this.keyName,
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/panels/Timelapse/TimelapseStatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ export default class TimelapseStatusPanel extends Mixins(BaseMixin, TimelapseMix
}

get existsSnapshoturlInMoonrakerConfig() {
return 'snapshoturl' in this.$store.state.server.config.orig.timelapse
return 'snapshoturl' in (this.$store.state.server.config_orig?.timelapse ?? {})
}

get moonrakerTimelapseConfig() {
return this.$store.state.server.config.config.timelapse ?? {}
return this.$store.getters['server/getConfigSection']('timelapse', {})
}

get camId() {
Expand Down
8 changes: 6 additions & 2 deletions src/components/panels/WebcamPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@ import Panel from '@/components/ui/Panel.vue'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import { mdiMenuDown, mdiViewGrid, mdiWebcam } from '@mdi/js'
import WebcamMixin from '@/components/mixins/webcam'
import { GuiState } from '@/store/gui/types'

type WebcamPages = keyof GuiState['view']['webcam']['currentCam']

@Component({
components: {
Panel,
},
})
export default class WebcamPanel extends Mixins(BaseMixin, WebcamMixin) {
@Prop({ default: 'dashboard' }) declare currentPage?: string
@Prop({ default: 'dashboard' }) declare currentPage?: WebcamPages

mdiWebcam = mdiWebcam
mdiMenuDown = mdiMenuDown
Expand All @@ -93,7 +96,8 @@ export default class WebcamPanel extends Mixins(BaseMixin, WebcamMixin) {
}

set currentCamId(newVal: string) {
this.$store.dispatch('gui/setCurrentWebcam', { page: this.currentPage, value: newVal })
const key = `view.webcam.currentCam.${this.currentPage}`
this.$store.dispatch('gui/saveSetting', { name: key, value: newVal })
}

get currentCam(): any {
Expand Down
7 changes: 2 additions & 5 deletions src/components/settings/SettingsMacrosTabSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import BaseMixin from '../mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { mdiMagnify } from '@mdi/js'
import { PrinterStateMacro } from '@/store/printer/types'
import { toggleArrayItem } from '@/plugins/helpers'

@Component({
components: { SettingsRow },
Expand Down Expand Up @@ -73,11 +74,7 @@ export default class SettingsMacrosTabSimple extends Mixins(BaseMixin) {
}

changeMacroStatus(name: string) {
const hiddenMacros = [...this.hiddenMacros]

if (this.hiddenMacros.includes(name.toUpperCase()))
hiddenMacros.splice(hiddenMacros.indexOf(name.toUpperCase()), 1)
else hiddenMacros.push(name.toUpperCase())
const hiddenMacros = toggleArrayItem(this.hiddenMacros, name.toUpperCase())

this.$store.dispatch('gui/macros/saveSetting', { name: 'hiddenMacros', value: hiddenMacros })
}
Expand Down
Loading
Loading