From 7c1bb6c349232255dc84eeb42e9e016d4d895721 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 29 Mar 2017 16:01:47 +0100 Subject: [PATCH] Fix broken build --- .../javascripts/commit/pipelines/pipelines_table.js | 5 ++++- app/assets/javascripts/lib/utils/poll.js | 11 ++++++++--- .../javascripts/vue_pipelines_index/pipelines.js | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js b/app/assets/javascripts/commit/pipelines/pipelines_table.js index 54f132746b3..9028e9b52b9 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.js +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js @@ -98,7 +98,10 @@ export default Vue.component('pipelines-table', { }, beforeUpdate() { - if (this.state.pipelines.length && this.$children && !this.isMakingRequest) { + if (this.state.pipelines.length && + this.$children && + !this.isMakingRequest && + !this.isLoading) { this.store.startTimeAgoLoops.call(this, Vue); } }, diff --git a/app/assets/javascripts/lib/utils/poll.js b/app/assets/javascripts/lib/utils/poll.js index 5c22aea51cd..e31cc5fbabe 100644 --- a/app/assets/javascripts/lib/utils/poll.js +++ b/app/assets/javascripts/lib/utils/poll.js @@ -65,7 +65,6 @@ export default class Poll { this.makeRequest(); }, pollInterval); } - this.options.successCallback(response); } @@ -76,8 +75,14 @@ export default class Poll { notificationCallback(true); return resource[method](data) - .then(response => this.checkConditions(response)) - .catch(error => errorCallback(error)); + .then((response) => { + this.checkConditions(response); + notificationCallback(false); + }) + .catch((error) => { + notificationCallback(false); + errorCallback(error); + }); } /** diff --git a/app/assets/javascripts/vue_pipelines_index/pipelines.js b/app/assets/javascripts/vue_pipelines_index/pipelines.js index b630ee094ee..f7536b6625b 100644 --- a/app/assets/javascripts/vue_pipelines_index/pipelines.js +++ b/app/assets/javascripts/vue_pipelines_index/pipelines.js @@ -157,7 +157,10 @@ export default { }, beforeUpdate() { - if (this.state.pipelines.length && this.$children && !this.isMakingRequest) { + if (this.state.pipelines.length && + this.$children && + !this.isMakingRequest && + !this.isLoading) { this.store.startTimeAgoLoops.call(this, Vue); } },