summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Scott Busche <swbusche@gmail.com> 2019-08-23 05:04:32 -0500
committerGravatar Federico Brigante <github@bfred.it> 2019-08-23 17:04:32 +0700
commitde0f096386c442811371e1edece1b19d89c4f1ab (patch)
tree85a30a6bb61e6371b74c1c9ef670f8d2292b17af
parent430fb5ca201b972253fe2b2d95c44d83431e2956 (diff)
downloadrefined-github-de0f096386c442811371e1edece1b19d89c4f1ab.tar.gz
refined-github-de0f096386c442811371e1edece1b19d89c4f1ab.tar.zst
refined-github-de0f096386c442811371e1edece1b19d89c4f1ab.zip
Fix console error in `mark-unread` on non-conversation views (#2354)
-rw-r--r--source/features/mark-unread.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/features/mark-unread.tsx b/source/features/mark-unread.tsx
index 155f837c..0411ac6c 100644
--- a/source/features/mark-unread.tsx
+++ b/source/features/mark-unread.tsx
@@ -412,8 +412,10 @@ async function init(): Promise<void> {
} else if (pageDetect.isPR() || pageDetect.isIssue()) {
await markRead(location.href);
- addMarkUnreadButton();
- onUpdatableContentUpdate(select('#partial-discussion-sidebar')!, addMarkUnreadButton);
+ if (pageDetect.isPRConversation() || pageDetect.isIssue()) {
+ addMarkUnreadButton();
+ onUpdatableContentUpdate(select('#partial-discussion-sidebar')!, addMarkUnreadButton);
+ }
} else if (pageDetect.isDiscussionList()) {
for (const discussion of await getNotifications()) {
const {pathname} = new URL(discussion.url);