summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/actions/project.js
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-10 01:20:53 -0500
committerMike Greiling <mike@pixelcog.com>2018-10-10 01:57:50 -0500
commit69b7c032ec7445730c02129d66146218833f47aa (patch)
tree188e1623ed150e67d7918ee377c3d325ff30f225 /app/assets/javascripts/ide/stores/actions/project.js
parent550f55745a3be5f86bafaf25b3bcc90beba8e2ac (diff)
downloadgitlab-ce-69b7c032ec7445730c02129d66146218833f47aa.tar.gz
Prettify ide modules
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions/project.js')
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js36
1 files changed, 15 insertions, 21 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js
index 543dc6c0461..2cb08ab2945 100644
--- a/app/assets/javascripts/ide/stores/actions/project.js
+++ b/app/assets/javascripts/ide/stores/actions/project.js
@@ -125,10 +125,7 @@ export const showBranchNotFoundError = ({ dispatch }, branchId) => {
});
};
-export const openBranch = (
- { dispatch, state },
- { projectId, branchId, basePath },
-) => {
+export const openBranch = ({ dispatch, state }, { projectId, branchId, basePath }) => {
dispatch('setCurrentBranchId', branchId);
dispatch('getBranchData', {
@@ -136,23 +133,20 @@ export const openBranch = (
branchId,
});
- return (
- dispatch('getFiles', {
- projectId,
- branchId,
- })
- .then(() => {
- if (basePath) {
- const path = basePath.slice(-1) === '/' ? basePath.slice(0, -1) : basePath;
- const treeEntryKey = Object.keys(state.entries).find(
- key => key === path && !state.entries[key].pending,
- );
- const treeEntry = state.entries[treeEntryKey];
+ return dispatch('getFiles', {
+ projectId,
+ branchId,
+ }).then(() => {
+ if (basePath) {
+ const path = basePath.slice(-1) === '/' ? basePath.slice(0, -1) : basePath;
+ const treeEntryKey = Object.keys(state.entries).find(
+ key => key === path && !state.entries[key].pending,
+ );
+ const treeEntry = state.entries[treeEntryKey];
- if (treeEntry) {
- dispatch('handleTreeEntryAction', treeEntry);
- }
+ if (treeEntry) {
+ dispatch('handleTreeEntryAction', treeEntry);
}
- })
- );
+ }
+ });
};