Skip to content

Commit

Permalink
fix: wrong default path in moonraker db (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored May 25, 2022
1 parent 86638ef commit fb4bfb3
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/store/gui/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ export const actions: ActionTree<GuiState, RootState> = {
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')
Expand Down Expand Up @@ -187,16 +207,16 @@ export const actions: ActionTree<GuiState, RootState> = {
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,
})
},

Expand Down

0 comments on commit fb4bfb3

Please sign in to comment.