diff options
author | Ajay Ramachandran <[email protected]> | 2019-07-29 14:22:46 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-07-29 14:22:46 -0400 |
commit | d6c5dbaff118f2be0c4c301e92e96ba9e6461912 (patch) | |
tree | 9165a3705757baf563517b3227a5c52860754dfd | |
parent | a66804064adb97d4f8c2e94019efdbf6eedc2aa5 (diff) | |
download | SponsorBlock-d6c5dbaff118f2be0c4c301e92e96ba9e6461912.tar.gz SponsorBlock-d6c5dbaff118f2be0c4c301e92e96ba9e6461912.zip |
Made deleting an unfinished sponsor time properly update buttons.
-rw-r--r-- | popup.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -479,6 +479,22 @@ function saveSponsorTimeEdit(index) { //deletes the sponsor time submitted at an index function deleteSponsorTime(index) { + //if it is not a complete sponsor time + if (sponsorTimes[index].length < 2) { + chrome.tabs.query({ + active: true, + currentWindow: true + }, function(tabs) { + chrome.tabs.sendMessage(tabs[0].id, { + message: "changeStartSponsorButton", + showStartSponsor: true, + uploadButtonVisible: false + }); + }); + + resetStartTimeChosen(); + } + sponsorTimes.splice(index, 1); //save this |