Limit rate at which scrolling causes thread watcher unread count to be saved. #1168
This commit is contained in:
parent
b78fe7f3cd
commit
f1c15e12c7
@ -231,12 +231,7 @@ Unread =
|
|||||||
Unread.title
|
Unread.title
|
||||||
d.title = "#{titleQuotingYou}#{titleCount}#{titleDead}"
|
d.title = "#{titleQuotingYou}#{titleCount}#{titleDead}"
|
||||||
|
|
||||||
$.forceSync 'Remember Last Read Post'
|
Unread.saveThreadWatcherCount()
|
||||||
if Conf['Remember Last Read Post'] and (!Unread.thread.isDead or Unread.thread.isArchived)
|
|
||||||
ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID,
|
|
||||||
isDead: Unread.thread.isDead
|
|
||||||
unread: count
|
|
||||||
quotingYou: countQuotingYou
|
|
||||||
|
|
||||||
if Conf['Unread Favicon']
|
if Conf['Unread Favicon']
|
||||||
{isDead} = Unread.thread
|
{isDead} = Unread.thread
|
||||||
@ -249,3 +244,11 @@ Unread =
|
|||||||
Favicon[if isDead then 'dead' else 'default']
|
Favicon[if isDead then 'dead' else 'default']
|
||||||
# `favicon.href = href` doesn't work on Firefox.
|
# `favicon.href = href` doesn't work on Firefox.
|
||||||
$.add d.head, Favicon.el
|
$.add d.head, Favicon.el
|
||||||
|
|
||||||
|
saveThreadWatcherCount: $.debounce 2 * $.SECOND, ->
|
||||||
|
$.forceSync 'Remember Last Read Post'
|
||||||
|
if Conf['Remember Last Read Post'] and (!Unread.thread.isDead or Unread.thread.isArchived)
|
||||||
|
ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID,
|
||||||
|
isDead: Unread.thread.isDead
|
||||||
|
unread: Unread.posts.size
|
||||||
|
quotingYou: Unread.postsQuotingYou.size
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user