From 387e49cd933fad32db99e580a92b4e47ce8ff59a Mon Sep 17 00:00:00 2001 From: Evandro Araujo Date: Sun, 23 Aug 2020 15:24:14 -0300 Subject: [PATCH] Migration for legacy connections --- src/renderer/App.vue | 2 ++ src/renderer/store/modules/Data.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index cc71392..a9574ec 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -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') diff --git a/src/renderer/store/modules/Data.js b/src/renderer/store/modules/Data.js index ec9dfcf..ec832d2 100644 --- a/src/renderer/store/modules/Data.js +++ b/src/renderer/store/modules/Data.js @@ -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: [] + } + } + }) } } @@ -53,6 +64,10 @@ const actions = { CLEAR_CONNECTIONS ({ commit }) { commit('CLEAR_CONNECTIONS') + }, + + APPLY_CONNECTIONS_MIGRATIONS ({ commit }) { + commit('MIGRATE_CONNECTIONS_ADVANCED_OPTIONS') } }