mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Made it show the new notice again.
This commit is contained in:
23
content.js
23
content.js
@@ -80,13 +80,22 @@ chrome.storage.sync.get(["trackViewCount"], function(result) {
|
||||
|
||||
//if the notice should not be shown
|
||||
//happens when the user click's the "Don't show notice again" button
|
||||
//option renamed when new notice was made
|
||||
var dontShowNotice = false;
|
||||
chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) {
|
||||
chrome.storage.sync.get(["dontShowNotice"], function(result) {
|
||||
let dontShowNoticeAgain = result.dontShowNoticeAgain;
|
||||
if (dontShowNoticeAgain != undefined) {
|
||||
dontShowNotice = dontShowNoticeAgain;
|
||||
}
|
||||
});
|
||||
//load the legacy option to hide the notice
|
||||
var dontShowNoticeOld = false;
|
||||
chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) {
|
||||
let dontShowNoticeAgain = result.dontShowNoticeAgain;
|
||||
if (dontShowNoticeAgain != undefined) {
|
||||
dontShowNoticeOld = dontShowNoticeAgain;
|
||||
}
|
||||
});
|
||||
|
||||
//get messages from the background script and the popup
|
||||
chrome.runtime.onMessage.addListener(messageListener);
|
||||
@@ -591,7 +600,15 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
|
||||
if (openNotice) {
|
||||
//send out the message saying that a sponsor message was skipped
|
||||
if (!dontShowNotice) {
|
||||
new SkipNotice(this, currentUUID);
|
||||
let skipNotice = new SkipNotice(this, currentUUID);
|
||||
|
||||
if (dontShowNoticeOld) {
|
||||
//show why this notice is showing
|
||||
skipNotice.addNoticeInfoMessage(chrome.i18n.getMessage("noticeUpdate"));
|
||||
|
||||
//disable this setting
|
||||
chrome.storage.sync.set({"dontShowNoticeAgain": false});
|
||||
}
|
||||
|
||||
//auto-upvote this sponsor
|
||||
if (trackViewCount) {
|
||||
@@ -912,7 +929,7 @@ function closeAllSkipNotices(){
|
||||
}
|
||||
|
||||
function dontShowNoticeAgain() {
|
||||
chrome.storage.sync.set({"dontShowNoticeAgain": true});
|
||||
chrome.storage.sync.set({"dontShowNotice": true});
|
||||
|
||||
dontShowNotice = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user