Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-03-27 13:57:58 +0300
committerPhil Hughes <me@iamphill.com>2018-03-28 16:08:32 +0300
commita515b459299e547b867408c9095af6e1ce427fff (patch)
tree3d489b45b89eda535db6baa91568fca24426f392 /app/assets/javascripts/ide/ide_router.js
parent89bb7b85ec1479cd46f758512891714d81eeb807 (diff)
remove extra state property
pending tabs now get added into openfiles & just filtered correctly
Diffstat (limited to 'app/assets/javascripts/ide/ide_router.js')
-rw-r--r--app/assets/javascripts/ide/ide_router.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/ide_router.js b/app/assets/javascripts/ide/ide_router.js
index db89c1d44db..25f55ac2f8a 100644
--- a/app/assets/javascripts/ide/ide_router.js
+++ b/app/assets/javascripts/ide/ide_router.js
@@ -76,11 +76,17 @@ router.beforeEach((to, from, next) => {
.then(() => {
if (to.params[0]) {
const path =
- to.params[0].slice(-1) === '/'
- ? to.params[0].slice(0, -1)
- : to.params[0];
- const treeEntry = store.state.entries[path];
- if (treeEntry) {
+ to.params[0].slice(-1) === '/' ? to.params[0].slice(0, -1) : to.params[0];
+ const treeEntry = Object.keys(store.state.entries).reduce((acc, key) => {
+ const file = store.state.entries[key];
+ if (key === path && !file.pending) {
+ return file;
+ }
+
+ return acc;
+ }, {});
+
+ if (Object.keys(treeEntry).length) {
store.dispatch('handleTreeEntryAction', treeEntry);
}
}