Fix regression from v1.11.8.0 causing delete link not to work when Cooldown is off. #466

This commit is contained in:
ccd0 2015-08-26 21:06:37 -07:00
parent e71cfc19ff
commit e9a8817d11
2 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,7 @@ DeleteLink =
else if msg = resDoc.getElementById 'errmsg' # error!
new Notice 'warning', msg.textContent, 20
$.on link, 'click', DeleteLink.toggle if post.fullID is DeleteLink.post.fullID
if /\bwait\b/i.test msg.textContent
if Conf['Quick Reply'] and Conf['Cooldown'] and /\bwait\b/i.test(msg.textContent)
DeleteLink.cooldown.start post, 5
DeleteLink.auto[+fileOnly][post.fullID] = true
DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText fileOnly

View File

@ -70,6 +70,7 @@ QR.cooldown =
QR.cooldown.save [post.board.ID]
secondsDeletion: (post) ->
return 0 unless Conf['Quick Reply'] and Conf['Cooldown']
cooldowns = QR.cooldown.data[post.board.ID] or {}
for start, cooldown of cooldowns
if !cooldown.delay? and cooldown.threadID is post.thread.ID and cooldown.postID is post.ID