Fixed clear times button having incorrect behavior.

This commit is contained in:
Ajay Ramachandran
2019-07-22 16:46:50 -04:00
parent baefc59954
commit b7a35f0823
2 changed files with 4 additions and 5 deletions

View File

@@ -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
});
});