Remove unsubmitted notification

This commit is contained in:
Ajay Ramachandran
2021-01-17 13:00:27 -05:00
parent 7bb8f446bf
commit 2fcfc989cf
6 changed files with 0 additions and 59 deletions

View File

@@ -46,7 +46,6 @@
], ],
"permissions": [ "permissions": [
"storage", "storage",
"notifications",
"https://sponsor.ajay.app/*" "https://sponsor.ajay.app/*"
], ],
"optional_permissions": [ "optional_permissions": [

View File

@@ -97,9 +97,6 @@
"wantToSubmit": { "wantToSubmit": {
"message": "Do you want to submit for video id" "message": "Do you want to submit for video id"
}, },
"leftTimes": {
"message": "You seem to have left some segments unsubmitted. Go back to that page to submit them (they are not deleted)."
},
"clearTimes": { "clearTimes": {
"message": "Clear Segments" "message": "Clear Segments"
}, },
@@ -631,12 +628,6 @@
"categoryUpdate2": { "categoryUpdate2": {
"message": "Open the options to skip intros, outros, merch, etc." "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"
},
"help": { "help": {
"message": "Help" "message": "Help"
} }

View File

@@ -152,23 +152,6 @@
<br/> <br/>
<br/> <br/>
<div option-type="toggle" sync-option="unsubmittedWarning">
<label class="switch-container" label-name="__MSG_unsubmittedWarning__">
<label class="switch">
<input type="checkbox" checked>
<span class="slider round"></span>
</label>
</label>
<br/>
<br/>
<div class="small-description">__MSG_unsubmittedWarningDescription__</div>
</div>
<br/>
<br/>
<div option-type="toggle" sync-option="forceChannelCheck"> <div option-type="toggle" sync-option="forceChannelCheck">
<label class="switch-container" label-name="__MSG_forceChannelCheck__"> <label class="switch-container" label-name="__MSG_forceChannelCheck__">
<label class="switch"> <label class="switch">

View File

@@ -52,16 +52,6 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
//this allows the callback to be called later //this allows the callback to be called later
return true; return true;
case "alertPrevious":
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"
});
}
break;
case "registerContentScript": case "registerContentScript":
registerFirefoxContentScript(request); registerFirefoxContentScript(request);
return false; return false;

View File

@@ -17,7 +17,6 @@ interface SBConfig {
sponsorTimesContributed: number, sponsorTimesContributed: number,
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
showTimeWithSkips: boolean, showTimeWithSkips: boolean,
unsubmittedWarning: boolean,
disableSkipping: boolean, disableSkipping: boolean,
trackViewCount: boolean, trackViewCount: boolean,
dontShowNotice: boolean, dontShowNotice: boolean,
@@ -150,7 +149,6 @@ const Config: SBObject = {
sponsorTimesContributed: 0, sponsorTimesContributed: 0,
submissionCountSinceCategories: 0, submissionCountSinceCategories: 0,
showTimeWithSkips: true, showTimeWithSkips: true,
unsubmittedWarning: true,
disableSkipping: false, disableSkipping: false,
trackViewCount: true, trackViewCount: true,
dontShowNotice: false, dontShowNotice: false,

View File

@@ -19,7 +19,6 @@ utils.wait(() => Config.config !== null, 5000, 10).then(addCSS);
//was sponsor data found when doing SponsorsLookup //was sponsor data found when doing SponsorsLookup
let sponsorDataFound = false; let sponsorDataFound = false;
let previousVideoID: VideoID = null;
//the actual sponsorTimes if loaded and UUIDs associated with them //the actual sponsorTimes if loaded and UUIDs associated with them
let sponsorTimes: SponsorTime[] = null; let sponsorTimes: SponsorTime[] = null;
//what video id are these sponsors for //what video id are these sponsors for
@@ -310,25 +309,6 @@ async function videoIDChange(id) {
} }
} }
//warn them if they had unsubmitted times
if (previousVideoID != null) {
//get the sponsor times from storage
const sponsorTimes = Config.config.segmentTimes.get(previousVideoID);
if (sponsorTimes != undefined && sponsorTimes.length > 0 && new URL(document.URL).host !== "music.youtube.com") {
//warn them that they have unsubmitted sponsor times
chrome.runtime.sendMessage({
message: "alertPrevious",
previousVideoID: previousVideoID
});
}
//set the previous video id to the currentID
previousVideoID = id;
} else {
//set the previous id now, don't wait for chrome.storage.get
previousVideoID = id;
}
//close popup //close popup
closeInfoMenu(); closeInfoMenu();