diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-18 16:00:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-18 16:00:31 +0300 |
commit | 16995b8c0d7e54dc997076d52eb318c0488d88fc (patch) | |
tree | 91d74644003a8f53a9f24b91004301d989d147d4 /app/assets/javascripts | |
parent | 2f7e0aba2fec30be86f2f6048fdb50e93b4365c8 (diff) |
Fixed web IDE review & commit editors getting into incorrect state
Closes #46392
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/ide/components/repo_editor.vue | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index f8678b602ac..f2178c06c10 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -43,9 +43,13 @@ export default { }, }, watch: { - file(oldVal, newVal) { + file(newVal, oldVal) { + if (oldVal.pending) { + this.removePendingTab(oldVal); + } + // Compare key to allow for files opened in review mode to be cached differently - if (newVal.key !== this.file.key) { + if (oldVal.key !== this.file.key) { this.initMonaco(); if (this.currentActivityView !== activityBarViews.edit) { @@ -99,6 +103,7 @@ export default { 'setFileViewMode', 'setFileEOL', 'updateViewer', + 'removePendingTab', ]), initMonaco() { if (this.shouldHideEditor) return; |