Skip to content

Commit db1c2da

Browse files
authored
FIxed Notification features (Mottie#172)
* Fixed setting custom indicator and interval * Updated notification visibility logic From @Mottie Updated logic for notification to should show up.
1 parent bc9181c commit db1c2da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

github-title-notification.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
function check() {
2828
let title = document.title,
2929
mail = document.querySelector(".mail-status"),
30-
hasUnread = mail ? mail.classList.contains("unread") : false;
30+
hasUnread = mail ? !mail.hidden : false;
3131
//
3232
if (!/^\(\d+\)/.test(title)) {
3333
title = title.replace(/^(\([^)]+\)\s)*/g, "");
@@ -49,14 +49,14 @@
4949
GM_registerMenuCommand("Set GitHub Title Notification Indicator", () => {
5050
const val = prompt("Indicator Value (it will be wrapped in parentheses)?", indicator);
5151
if (val !== null) {
52-
GM_setValue("indicator", indicator);
52+
GM_setValue("indicator", val);
5353
check();
5454
}
5555
});
5656
GM_registerMenuCommand("Set GitHub Title Notification Interval", () => {
5757
const val = prompt("Interval Value (in seconds)?", interval);
5858
if (val !== null) {
59-
GM_setValue("interval", interval);
59+
GM_setValue("interval", val);
6060
setTimer();
6161
}
6262
});

0 commit comments

Comments
 (0)