diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-02-08 19:28:45 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-02-08 19:28:45 +0300 |
commit | 9a074366e5aad8c7dc93ecb974609698c7e60e18 (patch) | |
tree | 6a696879e07558f8d91ecdee2a30cb65bb6fc90c /app | |
parent | 11d33873a8da5f90fd00bf0909dd1e9f8fca1448 (diff) |
backport fixes for pipelines_store frontend specs
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 | 2 | ||||
-rw-r--r-- | app/assets/javascripts/vue_realtime_listener/index.js.es6 | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 b/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 index 11a3449d99a..f1b41911b73 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 +++ b/app/assets/javascripts/commit/pipelines/pipelines_store.js.es6 @@ -26,7 +26,7 @@ class PipelinesStore { */ startTimeAgoLoops() { const startTimeLoops = () => { - this.timeLoopInterval = setInterval(function timeloopInterval() { + this.timeLoopInterval = setInterval(() => { this.$children[0].$children.reduce((acc, component) => { const timeAgoComponent = component.$children.filter(el => el.$options._componentTag === 'time-ago')[0]; acc.push(timeAgoComponent); diff --git a/app/assets/javascripts/vue_realtime_listener/index.js.es6 b/app/assets/javascripts/vue_realtime_listener/index.js.es6 index 95564152cce..30f6680a673 100644 --- a/app/assets/javascripts/vue_realtime_listener/index.js.es6 +++ b/app/assets/javascripts/vue_realtime_listener/index.js.es6 @@ -14,5 +14,16 @@ window.addEventListener('focus', startIntervals); window.addEventListener('blur', removeIntervals); document.addEventListener('beforeunload', removeAll); + + // add removeAll methods to stack + const stack = gl.VueRealtimeListener.reset; + gl.VueRealtimeListener.reset = () => { + gl.VueRealtimeListener.reset = stack; + removeAll(); + stack(); + }; }; + + // remove all event listeners and intervals + gl.VueRealtimeListener.reset = () => undefined; // noop })(window.gl || (window.gl = {})); |