mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Fixed clear times button having incorrect behavior.
This commit is contained in:
@@ -75,7 +75,7 @@ chrome.runtime.onMessage.addListener( // Detect URL Changes
|
||||
}
|
||||
|
||||
if (request.message == "changeStartSponsorButton") {
|
||||
changeStartSponsorButton(request.visibility, request.uploadButtonVisible);
|
||||
changeStartSponsorButton(request.showStartSponsor, request.uploadButtonVisible);
|
||||
}
|
||||
|
||||
if (request.message == "changeVideoPlayerControlsVisibility") {
|
||||
@@ -235,8 +235,8 @@ function startSponsorClicked() {
|
||||
});
|
||||
}
|
||||
|
||||
function changeStartSponsorButton(visibility, uploadButtonVisible) {
|
||||
if (visibility) {
|
||||
function changeStartSponsorButton(showStartSponsor, uploadButtonVisible) {
|
||||
if (showStartSponsor) {
|
||||
showingStartSponsor = true;
|
||||
document.getElementById("startSponsorImage").src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
|
||||
|
||||
|
||||
3
popup.js
3
popup.js
@@ -243,14 +243,13 @@ function getSponsorTimesMessage(sponsorTimes) {
|
||||
function clearTimes() {
|
||||
//send new sponsor time state to tab
|
||||
if (sponsorTimes.length > 0) {
|
||||
let visibility = sponsorTimes[sponsorTimes.length - 1].length >= 2;
|
||||
chrome.tabs.query({
|
||||
active: true,
|
||||
currentWindow: true
|
||||
}, function(tabs) {
|
||||
chrome.tabs.sendMessage(tabs[0].id, {
|
||||
message: "changeStartSponsorButton",
|
||||
visibility: visibility,
|
||||
showStartSponsor: true,
|
||||
uploadButtonVisible: false
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user