Added option to disable notification

This commit is contained in:
Ajay Ramachandran 2020-06-07 11:27:35 -04:00
parent 3f98e2fc73
commit 93316bf463
3 changed files with 16 additions and 6 deletions

View file

@ -623,5 +623,11 @@
},
"categoryUpdate2": {
"message": "Open the options to skip intros, outros, merch, etc."
},
"unsubmittedWarning": {
"message": "Unsubmitted Segments Notification"
},
"unsubmittedWarningDescription": {
"message": "Send a notification when you leave a video with segments that are not uploaded"
}
}

View file

@ -62,12 +62,14 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
//this allows the callback to be called later
return true;
case "alertPrevious":
chrome.notifications.create("stillThere" + Math.random(), {
type: "basic",
title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?",
message: chrome.i18n.getMessage("leftTimes"),
iconUrl: "./icons/LogoSponsorBlocker256px.png"
});
if (Config.config.unsubmittedWarning) {
chrome.notifications.create("stillThere" + Math.random(), {
type: "basic",
title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?",
message: chrome.i18n.getMessage("leftTimes"),
iconUrl: "./icons/LogoSponsorBlocker256px.png"
});
}
case "registerContentScript":
registerFirefoxContentScript(request);
return false;

View file

@ -15,6 +15,7 @@ interface SBConfig {
skipCount: number,
sponsorTimesContributed: number,
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
unsubmittedWarning: boolean,
disableSkipping: boolean,
trackViewCount: boolean,
dontShowNotice: boolean,
@ -132,6 +133,7 @@ var Config: SBObject = {
skipCount: 0,
sponsorTimesContributed: 0,
submissionCountSinceCategories: 0,
unsubmittedWarning: true,
disableSkipping: false,
trackViewCount: true,
dontShowNotice: false,