diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-27 12:19:40 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-27 12:19:40 +0300 |
commit | 6a651eb721dc421297c5f52c937d25faa139bc13 (patch) | |
tree | e49cd8968864bf95f23ba7dbea0be4f406483c92 /app/assets/javascripts/ide/stores/actions.js | |
parent | 26c241d955ec0528b202792b0cb1848e9fe07691 (diff) | |
parent | a8cb4322a07c2e167d866ed6d106f63c80c3343c (diff) |
Merge branch 'master' into 44846-improve-web-ide-left-panel-and-modes
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/actions.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js index ab3fb1422b8..9900eabb358 100644 --- a/app/assets/javascripts/ide/stores/actions.js +++ b/app/assets/javascripts/ide/stores/actions.js @@ -74,7 +74,7 @@ export const createTempEntry = ( } worker.addEventListener('message', ({ data }) => { - const { file } = data; + const { file, parentPath } = data; worker.terminate(); @@ -90,6 +90,10 @@ export const createTempEntry = ( dispatch('setFileActive', file.path); } + if (parentPath && !state.entries[parentPath].opened) { + commit(types.TOGGLE_TREE_OPEN, parentPath); + } + resolve(file); }); @@ -146,6 +150,14 @@ export const setCurrentBranchId = ({ commit }, currentBranchId) => { commit(types.SET_CURRENT_BRANCH, currentBranchId); }; +export const updateTempFlagForEntry = ({ commit, dispatch, state }, { file, tempFile }) => { + commit(types.UPDATE_TEMP_FLAG, { path: file.path, tempFile }); + + if (file.parentPath) { + dispatch('updateTempFlagForEntry', { file: state.entries[file.parentPath], tempFile }); + } +}; + export const toggleFileFinder = ({ commit }, fileFindVisible) => commit(types.TOGGLE_FILE_FINDER, fileFindVisible); |