From 3bba86f8f49fb5ed6afec68f702142156ef10342 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Wed, 25 May 2022 18:23:43 +0200 Subject: [PATCH 1/2] fix: remove stored currentPath settings from moonrakerDB if they exists Signed-off-by: Stefan Dej --- src/store/gui/actions.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/store/gui/actions.ts b/src/store/gui/actions.ts index 10a904f10..3fbab8222 100644 --- a/src/store/gui/actions.ts +++ b/src/store/gui/actions.ts @@ -29,6 +29,26 @@ export const actions: ActionTree = { delete payload.value.remoteprinters } + // delete currentPath if exists + if ( + 'view' in payload.value && + 'gcodefiles' in payload.value.view && + 'currentPath' in payload.value.view.gcodefiles + ) { + window.console.debug('remove currentPath from gui namespace') + await fetch(mainsailUrl + '&key=view.gcodefiles.currentPath', { method: 'DELETE' }) + } + + // delete currentPath if exists + if ( + 'view' in payload.value && + 'configfiles' in payload.value.view && + 'currentPath' in payload.value.view.configfiles + ) { + window.console.debug('remove currentPath from gui namespace') + await fetch(mainsailUrl + '&key=view.configfiles.currentPath', { method: 'DELETE' }) + } + //update cooldownGcode from V2.0.1 to V2.1.0 if ('cooldownGcode' in payload.value) { window.console.debug('update cooldownGcode to new namespace') From f55b5c28dbb4cbec18c12d863c6bd7d6123495ac Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Wed, 25 May 2022 18:41:49 +0200 Subject: [PATCH 2/2] fix: only safe current setting to moonraker db Signed-off-by: Stefan Dej --- src/store/gui/actions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/gui/actions.ts b/src/store/gui/actions.ts index 3fbab8222..65df52a80 100644 --- a/src/store/gui/actions.ts +++ b/src/store/gui/actions.ts @@ -207,16 +207,16 @@ export const actions: ActionTree = { setGcodefilesMetadata({ commit, dispatch, state }, data) { commit('setGcodefilesMetadata', data) dispatch('updateSettings', { - keyName: 'view.gcodefiles', - newVal: state.view.gcodefiles, + keyName: 'view.gcodefiles.hideMetadataColumns', + newVal: state.view.gcodefiles.hideMetadataColumns, }) }, setGcodefilesShowHiddenFiles({ commit, dispatch, state }, data) { commit('setGcodefilesShowHiddenFiles', data) dispatch('updateSettings', { - keyName: 'view.gcodefiles', - newVal: state.view.gcodefiles, + keyName: 'view.gcodefiles.showHiddenFiles', + newVal: state.view.gcodefiles.showHiddenFiles, }) },