From 79644546cef148a67e70280275c295f0d4889358 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 31 Oct 2013 04:16:47 +0100 Subject: [PATCH] Only listen to 'IndexRefresh' events when browsing the index. --- src/Monitoring/ThreadWatcher.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 7697ce4cb..2f2809cd4 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -10,9 +10,12 @@ ThreadWatcher = @list = @dialog.lastElementChild $.on d, 'QRPostSuccessful', @cb.post - $.on d, 'ThreadUpdate', @cb.threadUpdate if g.VIEW is 'thread' $.on d, '4chanXInitFinished', @ready - $.on d, 'IndexRefresh', @refresh + switch g.VIEW + when 'index' + $.on d, 'IndexRefresh', @refresh + when 'thread' + $.on d, 'ThreadUpdate', @cb.threadUpdate now = Date.now() if (@db.data.lastChecked or 0) < now - 2 * $.HOUR