Skip to content

Commit

Permalink
Migration for legacy connections
Browse files Browse the repository at this point in the history
  • Loading branch information
evsar3 committed Aug 23, 2020
1 parent 67e6ec4 commit 387e49c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default {
name: 'sshfs-win-manager',
mounted () {
this.$store.dispatch('APPLY_CONNECTIONS_MIGRATIONS')
ipcRenderer.on('terminate-child-processes', () => {
ProcessManager.terminateAll().then(() => {
ipcRenderer.send('child-processes-terminated')
Expand Down
15 changes: 15 additions & 0 deletions src/renderer/store/modules/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ const mutations = {

CLEAR_CONNECTIONS (state) {
state.connections = []
},

MIGRATE_CONNECTIONS_ADVANCED_OPTIONS (state) {
state.connections.forEach(conn => {
if (!conn.advanced) {
conn.advanced = {
customCmdlOptionsEnabled: false,
customCmdlOptions: []
}
}
})
}
}

Expand All @@ -53,6 +64,10 @@ const actions = {

CLEAR_CONNECTIONS ({ commit }) {
commit('CLEAR_CONNECTIONS')
},

APPLY_CONNECTIONS_MIGRATIONS ({ commit }) {
commit('MIGRATE_CONNECTIONS_ADVANCED_OPTIONS')
}
}

Expand Down

0 comments on commit 387e49c

Please sign in to comment.