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:
Diffstat (limited to 'app/assets/javascripts/ide/stores/actions/project.js')
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js
index 51e9bf6a84c..27f6848f1d6 100644
--- a/app/assets/javascripts/ide/stores/actions/project.js
+++ b/app/assets/javascripts/ide/stores/actions/project.js
@@ -11,8 +11,8 @@ export const getProjectData = ({ commit, state }, { namespace, projectId, force
commit(types.TOGGLE_LOADING, { entry: state });
service
.getProjectData(namespace, projectId)
- .then(res => res.data)
- .then(data => {
+ .then((res) => res.data)
+ .then((data) => {
commit(types.TOGGLE_LOADING, { entry: state });
commit(types.SET_PROJECT, { projectPath: `${namespace}/${projectId}`, project: data });
commit(types.SET_CURRENT_PROJECT, `${namespace}/${projectId}`);
@@ -44,8 +44,9 @@ export const refreshLastCommitData = ({ commit }, { projectId, branchId } = {})
commit: data.commit,
});
})
- .catch(() => {
+ .catch((e) => {
flash(__('Error loading last commit.'), 'alert', document, null, false, true);
+ throw e;
});
export const createNewBranchFromDefault = ({ state, dispatch, getters }, branch) =>
@@ -61,7 +62,7 @@ export const createNewBranchFromDefault = ({ state, dispatch, getters }, branch)
.catch(() => {
dispatch('setErrorMessage', {
text: __('An error occurred creating the new branch.'),
- action: payload => dispatch('createNewBranchFromDefault', payload),
+ action: (payload) => dispatch('createNewBranchFromDefault', payload),
actionText: __('Please try again'),
actionPayload: branch,
});
@@ -76,7 +77,7 @@ export const showBranchNotFoundError = ({ dispatch }, branchId) => {
},
false,
),
- action: payload => dispatch('createNewBranchFromDefault', payload),
+ action: (payload) => dispatch('createNewBranchFromDefault', payload),
actionText: __('Create branch'),
actionPayload: branchId,
});
@@ -102,7 +103,7 @@ export const loadFile = ({ dispatch, state }, { basePath }) => {
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,
+ (key) => key === path && !state.entries[key].pending,
);
const treeEntry = state.entries[treeEntryKey];
@@ -144,7 +145,7 @@ export const loadBranch = ({ dispatch, getters, state }, { projectId, branchId }
ref: branch.commit.id,
});
})
- .catch(err => {
+ .catch((err) => {
dispatch('showBranchNotFoundError', branchId);
throw err;
});