Commit 8611a1a1 authored by Phil Hughes's avatar Phil Hughes

Fix widget polling not respecting polling interval header

If the user sets the polling interval multiplier to 0 the widget
does not respect this. This changes that to make sure that
the widget respects the admin setting.
parent 325eb990
...@@ -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