diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index fdcbc7f16..6ccdf0244 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -104,9 +104,10 @@ Unread = notif.onclick = -> Header.scrollToPost post.nodes.root window.focus() - setTimeout -> - notif.close() - , 7 * $.SECOND + notif.onshow = -> + setTimeout -> + notif.close() + , 7 * $.SECOND onUpdate: (e) -> if e.detail[404] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index cad8ea4b4..2091d9045 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -122,10 +122,11 @@ QR = # Firefox automatically closes notifications # so we can't control the onclose properly. notif.onclose = -> notice.close() - setTimeout -> - notif.onclose = null - notif.close() - , 7 * $.SECOND + notif.onshow = -> + setTimeout -> + notif.onclose = null + notif.close() + , 7 * $.SECOND <% } %> notifications: [] cleanNotifications: -> @@ -1108,9 +1109,10 @@ QR = QR.open() QR.captcha.nodes.input.focus() window.focus() - setTimeout -> - notif.close() - , 7 * $.SECOND + notif.onshow = -> + setTimeout -> + notif.close() + , 7 * $.SECOND unless Conf['Persistent QR'] or QR.cooldown.auto QR.close()