Skip to content

Commit 990871b

Browse files
authored
Hide "used" buttons in notifications (refined-github#1332)
1 parent 0bd88cf commit 990871b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

source/features/open-all-notifications.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,19 @@ async function openNotifications({delegateTarget}) {
2828
action: 'openAllInTabs'
2929
});
3030

31-
// Mark all as read, this also enables the native "marked as read notification"
32-
for (const button of select.all('.mark-all-as-read', container)) {
33-
button.click();
31+
// Mark all as read
32+
for (const notification of select.all('.unread', container)) {
33+
notification.classList.replace('unread', 'read');
34+
}
35+
36+
// Remove all now-useless buttons
37+
for (const button of select.all(`
38+
.rgh-open-notifications-button,
39+
.open-repo-notifications,
40+
.mark-all-as-read,
41+
[href='#mark_as_read_confirm_box']
42+
`, container)) {
43+
button.remove();
3444
}
3545
}
3646

0 commit comments

Comments
 (0)