From b3ce37e0658d6ac5ddc0861aa28e9514edf73ce2 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 28 Nov 2015 11:30:59 -0800 Subject: [PATCH] Use QR.db to test whether Mark Quotes of You is on. Fixes backlinks crash on settings change and makes things more consistent. --- src/Miscellaneous/Keybinds.coffee | 4 ++-- src/Monitoring/Unread.coffee | 2 +- src/Quotelinks/QuoteBacklink.coffee | 2 +- src/Quotelinks/QuoteYou.coffee | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index e3f418bdf..60165764a 100644 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -184,10 +184,10 @@ Keybinds = return unless thread ThreadHiding.toggle thread if ThreadHiding.db when Conf['Previous Post Quoting You'] - return unless threadRoot + return unless threadRoot and QR.db QuoteYou.cb.seek 'preceding' when Conf['Next Post Quoting You'] - return unless threadRoot + return unless threadRoot and QR.db QuoteYou.cb.seek 'following' <% if (tests_enabled) { %> when 't' diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index aa465aaec..0b779c80b 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -175,7 +175,7 @@ Unread = Unread.posts.delete ID Unread.postsQuotingYou.delete ID - if Conf['Mark Quotes of You'] and QR.db?.get { + if QR.db?.get { boardID: data.board.ID threadID: data.thread.ID postID: ID diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index f41d5221c..d83eaa4c2 100644 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -22,7 +22,7 @@ QuoteBacklink = cb: @secondNode firstNode: -> return if @isClone or !@quotes.length or @isRebuilt - markYours = Conf['Quick Reply'] and Conf['Mark Quotes of You'] and QR.db.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID} + markYours = QR.db?.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID} a = $.el 'a', href: Build.postURL @board.ID, @thread.ID, @ID className: if @isHidden then 'filtered backlink' else 'backlink' diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 85da4b8b4..d127f45dc 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -34,7 +34,6 @@ QuoteYou = cb: seek: (type) -> - return unless Conf['Mark Quotes of You'] and Conf['Quick Reply'] $.rmClass highlight, 'highlight' if highlight = $ '.highlight' unless QuoteYou.lastRead