Commit 2395b4e9 authored by Tim Zallmann's avatar Tim Zallmann

Added return promise resolve

parent 2939b8b8
...@@ -21,7 +21,10 @@ export const receiveLabelsFailure = ({ commit }) => { ...@@ -21,7 +21,10 @@ export const receiveLabelsFailure = ({ commit }) => {
}); });
}; };
export const fetchLabels = ({ state, dispatch }) => { export const fetchLabels = ({ state, dispatch }) => {
if (!state.labelsFetched) { if (state.labelsFetched) {
return Promise.resolve();
}
dispatch('requestLabels'); dispatch('requestLabels');
return axios return axios
.get(state.labelsFetchPath) .get(state.labelsFetchPath)
...@@ -29,7 +32,6 @@ export const fetchLabels = ({ state, dispatch }) => { ...@@ -29,7 +32,6 @@ export const fetchLabels = ({ state, dispatch }) => {
dispatch('receiveLabelsSuccess', data); dispatch('receiveLabelsSuccess', data);
}) })
.catch(() => dispatch('receiveLabelsFailure')); .catch(() => dispatch('receiveLabelsFailure'));
}
}; };
export const requestCreateLabel = ({ commit }) => commit(types.REQUEST_CREATE_LABEL); export const requestCreateLabel = ({ commit }) => commit(types.REQUEST_CREATE_LABEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment