diff options
author | Phil Hughes <me@iamphill.com> | 2018-07-26 14:56:56 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-07-26 14:56:56 +0000 |
commit | cded268ca1d49fe93b8e0940586e9792347c88c3 (patch) | |
tree | 9d84a5e8ae38e53514b6ab1f4e99d38ddf2fe138 /app/assets/javascripts/ide/components/ide_tree.vue | |
parent | 8873840839811948b2f29175177b91bcf806a3f8 (diff) | |
download | gitlab-ce-cded268ca1d49fe93b8e0940586e9792347c88c3.tar.gz |
Enable deleting files in the Web IDE
Diffstat (limited to 'app/assets/javascripts/ide/components/ide_tree.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/ide_tree.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/components/ide_tree.vue b/app/assets/javascripts/ide/components/ide_tree.vue index 0a95c0bb30d..e996dd9059e 100644 --- a/app/assets/javascripts/ide/components/ide_tree.vue +++ b/app/assets/javascripts/ide/components/ide_tree.vue @@ -17,14 +17,18 @@ export default { ...mapGetters(['currentProject', 'currentTree', 'activeFile']), }, mounted() { - if (this.activeFile && this.activeFile.pending) { + if (!this.activeFile) return; + + if (this.activeFile.pending && !this.activeFile.deleted) { this.$router.push(`/project${this.activeFile.url}`, () => { this.updateViewer('editor'); }); + } else if (this.activeFile.deleted) { + this.resetOpenFiles(); } }, methods: { - ...mapActions(['updateViewer', 'openNewEntryModal', 'createTempEntry']), + ...mapActions(['updateViewer', 'openNewEntryModal', 'createTempEntry', 'resetOpenFiles']), }, }; </script> |