mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Don't break upload notice when clearing segments
This commit is contained in:
@@ -1201,6 +1201,8 @@ function cancelCreatingSegment() {
|
|||||||
if (isSegmentCreationInProgress()) {
|
if (isSegmentCreationInProgress()) {
|
||||||
sponsorTimesSubmitting.splice(sponsorTimesSubmitting.length - 1, 1);
|
sponsorTimesSubmitting.splice(sponsorTimesSubmitting.length - 1, 1);
|
||||||
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
|
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
|
||||||
|
|
||||||
|
if (sponsorTimesSubmitting.length <= 0) resetSponsorSubmissionNotice();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEditButtonsOnPlayer();
|
updateEditButtonsOnPlayer();
|
||||||
@@ -1335,6 +1337,8 @@ function clearSponsorTimes() {
|
|||||||
+ "\n" + chrome.i18n.getMessage("confirmMSG")
|
+ "\n" + chrome.i18n.getMessage("confirmMSG")
|
||||||
if(!confirm(confirmMessage)) return;
|
if(!confirm(confirmMessage)) return;
|
||||||
|
|
||||||
|
resetSponsorSubmissionNotice();
|
||||||
|
|
||||||
//clear the sponsor times
|
//clear the sponsor times
|
||||||
Config.config.segmentTimes.delete(currentVideoID);
|
Config.config.segmentTimes.delete(currentVideoID);
|
||||||
|
|
||||||
@@ -1342,7 +1346,6 @@ function clearSponsorTimes() {
|
|||||||
sponsorTimesSubmitting = [];
|
sponsorTimesSubmitting = [];
|
||||||
|
|
||||||
updatePreviewBar();
|
updatePreviewBar();
|
||||||
|
|
||||||
updateEditButtonsOnPlayer();
|
updateEditButtonsOnPlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1413,6 +1416,7 @@ function dontShowNoticeAgain() {
|
|||||||
* Helper method for the submission notice to clear itself when it closes
|
* Helper method for the submission notice to clear itself when it closes
|
||||||
*/
|
*/
|
||||||
function resetSponsorSubmissionNotice() {
|
function resetSponsorSubmissionNotice() {
|
||||||
|
submissionNotice?.close();
|
||||||
submissionNotice = null;
|
submissionNotice = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user