From 9bdfaa195e957814a2c7ad040d63dcf103698d8c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 28 May 2019 10:50:59 -0400 Subject: [PATCH] FIX: We shouldn't memoize the last time something is read --- app/assets/javascripts/discourse/lib/screen-track.js.es6 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/screen-track.js.es6 b/app/assets/javascripts/discourse/lib/screen-track.js.es6 index d048c798a91..363454e1e95 100644 --- a/app/assets/javascripts/discourse/lib/screen-track.js.es6 +++ b/app/assets/javascripts/discourse/lib/screen-track.js.es6 @@ -60,7 +60,7 @@ export default class { // Reset our timers reset() { - const now = this._getTime(); + const now = new Date().getTime(); this._lastTick = now; this._lastScrolled = now; this._lastFlush = 0; @@ -74,7 +74,7 @@ export default class { } scrolled() { - this._lastScrolled = this._getTime(); + this._lastScrolled = new Date().getTime(); } registerAnonCallback(cb) { @@ -224,8 +224,4 @@ export default class { }); } } - - _getTime() { - return (this._time = this._time || new Date().getTime()); - } }