Use QR.db to test whether Mark Quotes of You is on.

Fixes backlinks crash on settings change and makes things more consistent.
This commit is contained in:
ccd0 2015-11-28 11:30:59 -08:00
parent 808b8661f1
commit b3ce37e065
4 changed files with 4 additions and 5 deletions

View File

@ -184,10 +184,10 @@ Keybinds =
return unless thread return unless thread
ThreadHiding.toggle thread if ThreadHiding.db ThreadHiding.toggle thread if ThreadHiding.db
when Conf['Previous Post Quoting You'] when Conf['Previous Post Quoting You']
return unless threadRoot return unless threadRoot and QR.db
QuoteYou.cb.seek 'preceding' QuoteYou.cb.seek 'preceding'
when Conf['Next Post Quoting You'] when Conf['Next Post Quoting You']
return unless threadRoot return unless threadRoot and QR.db
QuoteYou.cb.seek 'following' QuoteYou.cb.seek 'following'
<% if (tests_enabled) { %> <% if (tests_enabled) { %>
when 't' when 't'

View File

@ -175,7 +175,7 @@ Unread =
Unread.posts.delete ID Unread.posts.delete ID
Unread.postsQuotingYou.delete ID Unread.postsQuotingYou.delete ID
if Conf['Mark Quotes of You'] and QR.db?.get { if QR.db?.get {
boardID: data.board.ID boardID: data.board.ID
threadID: data.thread.ID threadID: data.thread.ID
postID: ID postID: ID

View File

@ -22,7 +22,7 @@ QuoteBacklink =
cb: @secondNode cb: @secondNode
firstNode: -> firstNode: ->
return if @isClone or !@quotes.length or @isRebuilt 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', a = $.el 'a',
href: Build.postURL @board.ID, @thread.ID, @ID href: Build.postURL @board.ID, @thread.ID, @ID
className: if @isHidden then 'filtered backlink' else 'backlink' className: if @isHidden then 'filtered backlink' else 'backlink'

View File

@ -34,7 +34,6 @@ QuoteYou =
cb: cb:
seek: (type) -> seek: (type) ->
return unless Conf['Mark Quotes of You'] and Conf['Quick Reply']
$.rmClass highlight, 'highlight' if highlight = $ '.highlight' $.rmClass highlight, 'highlight' if highlight = $ '.highlight'
unless QuoteYou.lastRead unless QuoteYou.lastRead