Fix bug where cancelling path choice dialog would end up not being able to open any more dialog + random dialog appearance

This commit is contained in:
Kylart 2017-09-14 21:33:26 +02:00
parent 769d89838e
commit ba518703f3
2 changed files with 13 additions and 7 deletions

View File

@ -57,6 +57,8 @@ exports.openExternal = (query, res) => {
} }
sendRes(res, result) sendRes(res, result)
} else {
sendEmptyRes(res)
} }
}) })
break break

View File

@ -327,17 +327,21 @@ export default {
async changePath ({commit, dispatch}) { async changePath ({commit, dispatch}) {
const {data} = await axios.get('openThis?type=dialog') const {data} = await axios.get('openThis?type=dialog')
commit('emptyLocals') if (data) {
commit('setCurrentDir', data.path) commit('emptyLocals')
dispatch('refreshLocal') commit('setCurrentDir', data.path)
dispatch('refreshLocal')
}
}, },
async changePathWithConfig ({commit, dispatch}) { async changePathWithConfig ({commit, dispatch}) {
const {data} = await axios.get('openThis?type=dialog') const {data} = await axios.get('openThis?type=dialog')
commit('emptyLocals') if (data) {
commit('setCurrentDir', data.path) commit('emptyLocals')
commit('setConfigDir', data.path) commit('setCurrentDir', data.path)
dispatch('refreshLocal') commit('setConfigDir', data.path)
dispatch('refreshLocal')
}
}, },
async openNewsLink ({state}, link) { async openNewsLink ({state}, link) {
log(`Opening ${link}`) log(`Opening ${link}`)