Commit 434970c6 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'ph/fixWidgetPollingDisable' into 'master'

Fix widget polling not respecting polling interval header

See merge request gitlab-org/gitlab!82417
parents 6b93e111 8611a1a1
...@@ -352,6 +352,8 @@ export default { ...@@ -352,6 +352,8 @@ export default {
return Promise.resolve(); return Promise.resolve();
}, },
initPolling() { initPolling() {
if (this.startingPollInterval <= 0) return;
this.pollingInterval = new SmartInterval({ this.pollingInterval = new SmartInterval({
callback: this.checkStatus, callback: this.checkStatus,
startingInterval: this.startingPollInterval, startingInterval: this.startingPollInterval,
...@@ -435,10 +437,10 @@ export default { ...@@ -435,10 +437,10 @@ export default {
notify.notifyMe(title, message, this.mr.gitlabLogo); notify.notifyMe(title, message, this.mr.gitlabLogo);
}, },
resumePolling() { resumePolling() {
this.pollingInterval.resume(); this.pollingInterval?.resume();
}, },
stopPolling() { stopPolling() {
this.pollingInterval.stopTimer(); this.pollingInterval?.stopTimer();
}, },
bindEventHubListeners() { bindEventHubListeners() {
eventHub.$on('MRWidgetUpdateRequested', (cb) => { eventHub.$on('MRWidgetUpdateRequested', (cb) => {
......
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