From 24f1458a73a7b95c8248783de91c68f274948711 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 18 Mar 2019 21:54:02 -0700 Subject: [PATCH] Fix issues from https://github.com/ccd0/4chan-x/pull/2231#issuecomment-467247167 #2231 --- src/Filtering/Filter.coffee | 16 ++-------------- src/Monitoring/Unread.coffee | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee index 28d463389..d77057462 100644 --- a/src/Filtering/Filter.coffee +++ b/src/Filtering/Filter.coffee @@ -162,20 +162,8 @@ Filter = if hl @highlights = hl $.addClass @nodes.root, hl... - if noti - if Header.areNotificationsEnabled - if not (Unread.posts is null) - if (@ID > Unread.lastReadPost) and not QuoteYou.isYou(@) - notif = new Notification "#{@info.nameBlock} triggered a notification filter", - body: @commentDisplay() - icon: Favicon.logo - notif.onclick = -> - Header.scrollToIfNeeded @nodes.bottom, true - window.focus() - notif.onshow = -> - setTimeout -> - notif.close() - , 7 * $.SECOND + if noti and Unread.posts and (@ID > Unread.lastReadPost) and not QuoteYou.isYou(@) + Unread.openNotification @, ' triggered a notification filter' isHidden: (post) -> !!Filter.test(post).hide diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 4714deff8..50a9a9c28 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -124,9 +124,9 @@ Unread = Unread.openNotification post return - openNotification: (post) -> + openNotification: (post, predicate=' replied to you') -> return unless Header.areNotificationsEnabled - notif = new Notification "#{post.info.nameBlock} replied to you", + notif = new Notification "#{post.info.nameBlock}#{predicate}", body: post.commentDisplay() icon: Favicon.logo notif.onclick = ->