summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-06-11 11:42:47 +0100
committerPhil Hughes <me@iamphill.com>2018-06-11 11:42:47 +0100
commit7469b58eafb2658542211479cd2e615203f94248 (patch)
tree148fb9a598519c58d806a0e6fd85ba7f325d9faa /app/assets/javascripts
parentba4dc01ea83c261c4054c32482b021a1005a1968 (diff)
downloadgitlab-ce-7469b58eafb2658542211479cd2e615203f94248.tar.gz
Fix IDE pipelines eTagPoll not stopping
Closes #47678
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/ide/stores/modules/merge_requests/actions.js9
-rw-r--r--app/assets/javascripts/ide/stores/modules/pipelines/actions.js12
2 files changed, 15 insertions, 6 deletions
diff --git a/app/assets/javascripts/ide/stores/modules/merge_requests/actions.js b/app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
index 5beb8fac71f..4e1df80b3a2 100644
--- a/app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
+++ b/app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
@@ -31,10 +31,15 @@ export const openMergeRequest = ({ commit, dispatch }, { projectPath, id }) => {
commit(rootTypes.CLEAR_PROJECTS, null, { root: true });
commit(rootTypes.SET_CURRENT_MERGE_REQUEST, `${id}`, { root: true });
commit(rootTypes.RESET_OPEN_FILES, null, { root: true });
- dispatch('pipelines/stopPipelinePolling', null, { root: true });
- dispatch('pipelines/clearEtagPoll', null, { root: true });
dispatch('pipelines/resetLatestPipeline', null, { root: true });
dispatch('setCurrentBranchId', '', { root: true });
+ dispatch('pipelines/stopPipelinePolling', null, { root: true })
+ .then(() => {
+ dispatch('pipelines/clearEtagPoll', null, { root: true });
+ })
+ .catch(e => {
+ throw e;
+ });
router.push(`/project/${projectPath}/merge_requests/${id}`);
};
diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/actions.js b/app/assets/javascripts/ide/stores/modules/pipelines/actions.js
index 0a4ea80c4c1..6718f7eae4e 100644
--- a/app/assets/javascripts/ide/stores/modules/pipelines/actions.js
+++ b/app/assets/javascripts/ide/stores/modules/pipelines/actions.js
@@ -12,8 +12,12 @@ let eTagPoll;
export const clearEtagPoll = () => {
eTagPoll = null;
};
-export const stopPipelinePolling = () => eTagPoll && eTagPoll.stop();
-export const restartPipelinePolling = () => eTagPoll && eTagPoll.restart();
+export const stopPipelinePolling = () => {
+ if (eTagPoll) eTagPoll.stop();
+};
+export const restartPipelinePolling = () => {
+ if (eTagPoll) eTagPoll.restart();
+};
export const requestLatestPipeline = ({ commit }) => commit(types.REQUEST_LATEST_PIPELINE);
export const receiveLatestPipelineError = ({ commit, dispatch }) => {
@@ -51,9 +55,9 @@ export const fetchLatestPipeline = ({ dispatch, rootGetters }) => {
Visibility.change(() => {
if (!Visibility.hidden()) {
- eTagPoll.restart();
+ dispatch('restartPipelinePolling');
} else {
- eTagPoll.stop();
+ dispatch('stopPipelinePolling');
}
});
};