Added notice info about the Invidious update. TODO: remove this in the future.

This commit is contained in:
Ajay Ramachandran 2020-01-10 22:15:28 -05:00
parent 4f8e1bc827
commit 259f7a9439
4 changed files with 19 additions and 1 deletions

1
SB.js
View file

@ -161,6 +161,7 @@ SB.defaults = {
"hideDiscordLaunches": 0,
"hideDiscordLink": false,
"invidiousInstances": ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
"invidiousUpdateInfoShowCount": 0,
"autoUpvote": true
}

View file

@ -380,5 +380,11 @@
},
"whatAutoUpvote": {
"message": "With this enabled, the extension will upvote all submissions you view if you do not report them. If the notice is disabled, this will not occur."
},
"invidiousInfo1": {
"message": "Invidious (the 3rd party YouTube site) support has been added!"
},
"invidiousInfo2": {
"message": "You MUST enable it in the options for it to work."
}
}

View file

@ -74,7 +74,11 @@ chrome.runtime.onInstalled.addListener(function (object) {
//generate a userID
const newUserID = generateUserID();
//save this UUID
SB.config.userID = newUserID;
SB.config.userID = newUserID;
//TODO: Remove when invidious support is old
// Don't show this to new users
SB.config.invidiousUpdateInfoShowCount = 6;
}
}, 1500);
});

View file

@ -557,6 +557,13 @@ function skipToTime(v, index, sponsorTimes, openNotice) {
if (!SB.config.dontShowNotice) {
let skipNotice = new SkipNotice(this, currentUUID, SB.config.disableAutoSkip);
//TODO: Remove this when Invidious support is old
if (SB.config.invidiousUpdateInfoShowCount < 5) {
skipNotice.addNoticeInfoMessage(chrome.i18n.getMessage("invidiousInfo1"), chrome.i18n.getMessage("invidiousInfo2"));
SB.config.invidiousUpdateInfoShowCount += 1;
}
//auto-upvote this sponsor
if (SB.config.trackViewCount && !SB.config.disableAutoSkip && SB.config.autoUpvote) {
vote(1, currentUUID, null);