diff --git a/app/services/update-times.js b/app/services/update-times.js index 765fc387..5585ab38 100644 --- a/app/services/update-times.js +++ b/app/services/update-times.js @@ -6,12 +6,18 @@ export default Ember.Service.extend({ allowFinishedBuilds: false, init() { - Visibility.every(Config.intervals.updateTimes, this.updateTimes.bind(this)); - setInterval(this.resetAllowFinishedBuilds.bind(this), 60000); + this.set('visibilityId', Visibility.every(Config.intervals.updateTimes, this.updateTimes.bind(this))); + this.set('intervalId', setInterval(this.resetAllowFinishedBuilds.bind(this), 60000)); return this._super(...arguments); }, + willDestroy() { + Visibility.stop(this.get('visibilityId')); + clearInterval(this.get('intervalId')); + this._super(...arguments); + }, + resetAllowFinishedBuilds() { this.set('allowFinishedBuilds', true); },