diff options
author | Ajay Ramachandran <[email protected]> | 2019-07-22 16:46:50 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-07-22 16:46:50 -0400 |
commit | b7a35f0823d399d5538f40c80fcf414f33ad0d40 (patch) | |
tree | 6172e8ad470f301a6b000196e32158444b206895 | |
parent | baefc5995461f38beaed5759928ff6bbf27f923d (diff) | |
download | SponsorBlock-b7a35f0823d399d5538f40c80fcf414f33ad0d40.tar.gz SponsorBlock-b7a35f0823d399d5538f40c80fcf414f33ad0d40.zip |
Fixed clear times button having incorrect behavior.
-rw-r--r-- | content.js | 6 | ||||
-rw-r--r-- | popup.js | 3 |
2 files changed, 4 insertions, 5 deletions
@@ -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"); @@ -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 }); }); |