Don't call Unread.update all the time.

This commit is contained in:
Nicolas Stepien 2013-03-31 01:26:02 +01:00
parent 7126768855
commit f308eed714

View File

@ -3718,7 +3718,7 @@ Unread =
else if Unread.hr.parentNode else if Unread.hr.parentNode
$.rm Unread.hr $.rm Unread.hr
update: -> update: <% if (type === 'crx') { %>(dontrepeat) <% } %>->
count = Unread.posts.length count = Unread.posts.length
if Conf['Unread Count'] if Conf['Unread Count']
@ -3729,11 +3729,13 @@ Unread =
<% if (type === 'crx') { %> <% if (type === 'crx') { %>
# XXX Chrome bug where it doesn't always update the tab title. # XXX Chrome bug where it doesn't always update the tab title.
# crbug.com/124381 # crbug.com/124381
title = d.title # Call it one second later,
setTimeout -> # but don't display outdated unread count.
d.title = '' unless dontrepeat
Unread.update() setTimeout ->
, $.SECOND d.title = ''
Unread.update true
, $.SECOND
<% } %> <% } %>
return unless Conf['Unread Tab Icon'] return unless Conf['Unread Tab Icon']