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-04-05 12:46:19 +0300
committerPhil Hughes <me@iamphill.com>2018-04-05 18:33:50 +0300
commitb61aa6f813a90aa104cb92dca687647171476337 (patch)
treefdac2ff7cc77b6af31b997d690aed0bad837382d /app/assets/javascripts/ide/stores/mutations
parent748cd7676242b8950ad81577af92e80303d783d6 (diff)
fixed staged/unstaged files not opening when another 1 is open
fixes eslint
Diffstat (limited to 'app/assets/javascripts/ide/stores/mutations')
-rw-r--r--app/assets/javascripts/ide/stores/mutations/file.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations/file.js b/app/assets/javascripts/ide/stores/mutations/file.js
index 0f5c64076b7..5549d601603 100644
--- a/app/assets/javascripts/ide/stores/mutations/file.js
+++ b/app/assets/javascripts/ide/stores/mutations/file.js
@@ -154,9 +154,10 @@ export default {
});
},
[types.ADD_PENDING_TAB](state, { file, keyPrefix = 'pending' }) {
- const pendingTab = state.openFiles.find(f => f.path === file.path && f.pending);
+ const key = `${keyPrefix}-${file.key}`;
+ const pendingTab = state.openFiles.find(f => f.key === key && f.pending);
let openFiles = state.openFiles.map(f =>
- Object.assign(f, { active: f.path === file.path, opened: false, active: false }),
+ Object.assign(f, { active: f.key === key, opened: false }),
);
if (!pendingTab) {
@@ -172,7 +173,7 @@ export default {
active: true,
pending: true,
opened: true,
- key: `${keyPrefix}-${f.key}`,
+ key,
});
}