From 7bdeabedd86f14983dde9ab193b885e29291dcd8 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 14 Feb 2013 21:49:47 +0100 Subject: [PATCH] Fix thread updater not thread updating on successful post. --- 4chan_x.user.js | 8 ++++---- src/features.coffee | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 6edf5d9a1..9dd7b7d11 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3865,12 +3865,12 @@ return ThreadUpdater.cb.autoUpdate(); }, post: function(e) { - if (!(Conf['Auto Update This'] && +e.detail.threadID === this.thread.ID)) { + if (!(Conf['Auto Update This'] && +e.detail.threadID === ThreadUpdater.thread.ID)) { return; } - this.outdateCount = 0; - if (this.seconds > 2) { - return setTimeout(this.update.bind(this), 1000); + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > 2) { + return setTimeout(ThreadUpdater.update, 1000); } }, visibility: function() { diff --git a/src/features.coffee b/src/features.coffee index 126780521..c1f6adfe0 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -2383,9 +2383,9 @@ ThreadUpdater = ThreadUpdater.set 'status', 'Offline', 'warning' ThreadUpdater.cb.autoUpdate() post: (e) -> - return unless Conf['Auto Update This'] and +e.detail.threadID is @thread.ID - @outdateCount = 0 - setTimeout @update.bind(@), 1000 if @seconds > 2 + return unless Conf['Auto Update This'] and +e.detail.threadID is ThreadUpdater.thread.ID + ThreadUpdater.outdateCount = 0 + setTimeout ThreadUpdater.update, 1000 if ThreadUpdater.seconds > 2 visibility: -> return if $.hidden() # Reset the counter when we focus this tab.