diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-10 01:20:53 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-10 01:57:50 -0500 |
commit | 69b7c032ec7445730c02129d66146218833f47aa (patch) | |
tree | 188e1623ed150e67d7918ee377c3d325ff30f225 /app/assets/javascripts/ide/stores/actions/project.js | |
parent | 550f55745a3be5f86bafaf25b3bcc90beba8e2ac (diff) | |
download | gitlab-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.js | 36 |
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); } - }) - ); + } + }); }; |