Don't allow submissions on active premieres or livestreams

Fix #523
Fix #367
This commit is contained in:
Ajay
2022-01-16 13:56:57 -05:00
parent 6b6ca6198f
commit b6c1ee1743
2 changed files with 9 additions and 0 deletions

View File

@@ -1798,6 +1798,12 @@ function submitSponsorTimes() {
//send the message to the background js
//called after all the checks have been made that it's okay to do so
async function sendSubmitMessage() {
// Block if submitting on a running livestream or premiere
if (isVisible(document.querySelector(".ytp-live-badge"))) {
alert(chrome.i18n.getMessage("liveOrPremiere"));
return;
}
// Add loading animation
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker.svg");
const stopAnimation = AnimationUtils.applyLoadingAnimation(playerButtons.submit.button, 1, () => updateEditButtonsOnPlayer());