diff options
Diffstat (limited to 'app/assets/javascripts/ide/stores/mutations/file.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/mutations/file.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations/file.js b/app/assets/javascripts/ide/stores/mutations/file.js index 65ea1e46b58..5dcbf9aa294 100644 --- a/app/assets/javascripts/ide/stores/mutations/file.js +++ b/app/assets/javascripts/ide/stores/mutations/file.js @@ -6,12 +6,14 @@ export default { active, }); - Object.assign(state, { - pendingTabs: state.pendingTabs.map(f => ({ - ...f, - active: false, - })), - }); + if (active) { + Object.assign(state, { + pendingTabs: state.pendingTabs.map(f => ({ + ...f, + active: false, + })), + }); + } }, [types.TOGGLE_FILE_OPEN](state, path) { Object.assign(state.entries[path], { @@ -105,10 +107,11 @@ export default { pending: true, key: `pending-${file.key}`, }), - openFiles: state.openFiles.map(f => ({ - ...f, - active: false, - })), + openFiles: state.openFiles.map(f => + Object.assign(f, { + active: false, + }), + ), }); } }, |