From 28093b23480aba3b62d44bc9318ac45c67652c1e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 6 Apr 2019 06:29:44 -0700 Subject: [PATCH] Revert most of "Also avoid full Thread Watcher rebuild on removing entry." This reverts most of commit 4fe17ac6efd669d2bfee09adfd44951bbf612732. Keep consolidation of duplicated code. --- src/Monitoring/ThreadWatcher.coffee | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index c4d907084..f488f1771 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -494,9 +494,6 @@ ThreadWatcher = ThreadWatcher.shortcut.classList.toggle className, !!$(".#{className}", ThreadWatcher.dialog) return - getLine: (siteID, boardID, threadID) -> - $ "#watched-threads > [data-site-i-d='#{siteID}'][data-full-i-d='#{boardID}.#{threadID}']", ThreadWatcher.dialog - update: (siteID, boardID, threadID, newData) -> return if not (data = ThreadWatcher.db?.get {siteID, boardID, threadID}) if newData.isDead and Conf['Auto Prune'] @@ -509,7 +506,7 @@ ThreadWatcher = n++ for key, val of newData when data[key] isnt val return unless n ThreadWatcher.db.extend {siteID, boardID, threadID, val: newData} - if (line = ThreadWatcher.getLine siteID, boardID, threadID) + if (line = $ "#watched-threads > [data-site-i-d='#{siteID}'][data-full-i-d='#{boardID}.#{threadID}']", ThreadWatcher.dialog) newLine = ThreadWatcher.makeLine siteID, boardID, threadID, data $.replace line, newLine ThreadWatcher.refreshIcon() @@ -557,7 +554,7 @@ ThreadWatcher = rm: (siteID, boardID, threadID) -> ThreadWatcher.db.delete {siteID, boardID, threadID} - $.rm ThreadWatcher.getLine(siteID, boardID, threadID) + ThreadWatcher.refresh() menu: init: ->