aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-22 16:46:50 -0400
committerAjay Ramachandran <[email protected]>2019-07-22 16:46:50 -0400
commitb7a35f0823d399d5538f40c80fcf414f33ad0d40 (patch)
tree6172e8ad470f301a6b000196e32158444b206895
parentbaefc5995461f38beaed5759928ff6bbf27f923d (diff)
downloadSponsorBlock-b7a35f0823d399d5538f40c80fcf414f33ad0d40.tar.gz
SponsorBlock-b7a35f0823d399d5538f40c80fcf414f33ad0d40.zip
Fixed clear times button having incorrect behavior.
-rw-r--r--content.js6
-rw-r--r--popup.js3
2 files changed, 4 insertions, 5 deletions
diff --git a/content.js b/content.js
index 2e2310fe..1fdccecc 100644
--- a/content.js
+++ b/content.js
@@ -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");
diff --git a/popup.js b/popup.js
index 561a273e..6445a3bf 100644
--- a/popup.js
+++ b/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
});
});