Made deleting an unfinished sponsor time properly update buttons.

This commit is contained in:
Ajay Ramachandran
2019-07-29 14:22:46 -04:00
parent a66804064a
commit d6c5dbaff1

View File

@@ -479,6 +479,22 @@ function saveSponsorTimeEdit(index) {
//deletes the sponsor time submitted at an index //deletes the sponsor time submitted at an index
function deleteSponsorTime(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); sponsorTimes.splice(index, 1);
//save this //save this