aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-07-29 14:22:46 -0400
committerAjay Ramachandran <[email protected]>2019-07-29 14:22:46 -0400
commitd6c5dbaff118f2be0c4c301e92e96ba9e6461912 (patch)
tree9165a3705757baf563517b3227a5c52860754dfd
parenta66804064adb97d4f8c2e94019efdbf6eedc2aa5 (diff)
downloadSponsorBlock-d6c5dbaff118f2be0c4c301e92e96ba9e6461912.tar.gz
SponsorBlock-d6c5dbaff118f2be0c4c301e92e96ba9e6461912.zip
Made deleting an unfinished sponsor time properly update buttons.
-rw-r--r--popup.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/popup.js b/popup.js
index 0b7e4bce..f0618f52 100644
--- a/popup.js
+++ b/popup.js
@@ -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