mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 14:37:23 +03:00
Made deleting an unfinished sponsor time properly update buttons.
This commit is contained in:
16
popup.js
16
popup.js
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user