diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-05-23 09:11:52 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-05-23 10:22:39 +0100 |
commit | 1d77de4713f49ccacb6e8819bc70321b5950ab28 (patch) | |
tree | 5e7379af4a2af765c7fc4c9a356bd649cfa76edd /app | |
parent | 8c22568d4035712fdba913a96e61f57b65b8aa17 (diff) | |
download | gitlab-ce-1d77de4713f49ccacb6e8819bc70321b5950ab28.tar.gz |
Merge branch 'ide-commit-state-bug' into 'master'
Fixed web IDE review & commit editors getting into incorrect state
Closes #46392
See merge request gitlab-org/gitlab-ce!19038
Diffstat (limited to 'app')
-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; |