From c5490f6aecc6df139c08fce100479702835c1b26 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Sat, 1 Feb 2014 15:41:36 +0100 Subject: [PATCH] Fix cooldowns never expiring. --- src/Posting/QR.cooldown.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index 2c0c7a4e0..2f6a16f71 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -15,8 +15,7 @@ QR.cooldown = QR.cooldown.start() $.sync key, QR.cooldown.sync start: -> - return unless Conf['Cooldown'] - return if QR.cooldown.isCounting + return if QR.cooldown.isCounting or !Object.keys(QR.cooldown.cooldowns).length QR.cooldown.isCounting = true QR.cooldown.count() sync: (cooldowns) -> @@ -65,6 +64,7 @@ QR.cooldown = {types, cooldowns, upSpd, upSpdAccuracy} = QR.cooldown for start, cooldown of cooldowns + start = +start if 'delay' of cooldown if cooldown.delay seconds = Math.max seconds, cooldown.delay-- @@ -77,7 +77,9 @@ QR.cooldown = # Only cooldowns relevant to this post can set the seconds variable: # reply cooldown with a reply, thread cooldown with a thread elapsed = (now - start) // $.SECOND - continue if elapsed < 0 # clock changed since then? + if elapsed < 0 # clock changed since then? + QR.cooldown.unset start + continue type = unless isReply 'thread' else if hasFile