aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-05-22 01:51:50 -0400
committerAjay Ramachandran <[email protected]>2021-05-22 01:51:50 -0400
commit60c0af2ae7bd6db6fdc5f65ff5b4c88e17bebe54 (patch)
treec1f9a057e8004b2aad75fed6e64fa4a0392abdcc
parent628871f037f8456275aba12f726f275722d64b59 (diff)
downloadSponsorBlock-60c0af2ae7bd6db6fdc5f65ff5b4c88e17bebe54.tar.gz
SponsorBlock-60c0af2ae7bd6db6fdc5f65ff5b4c88e17bebe54.zip
Don't break upload notice when clearing segments
-rw-r--r--src/content.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index 6c5a5a4f..11c77599 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1201,6 +1201,8 @@ function cancelCreatingSegment() {
if (isSegmentCreationInProgress()) {
sponsorTimesSubmitting.splice(sponsorTimesSubmitting.length - 1, 1);
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
+
+ if (sponsorTimesSubmitting.length <= 0) resetSponsorSubmissionNotice();
}
updateEditButtonsOnPlayer();
@@ -1335,6 +1337,8 @@ function clearSponsorTimes() {
+ "\n" + chrome.i18n.getMessage("confirmMSG")
if(!confirm(confirmMessage)) return;
+ resetSponsorSubmissionNotice();
+
//clear the sponsor times
Config.config.segmentTimes.delete(currentVideoID);
@@ -1342,7 +1346,6 @@ function clearSponsorTimes() {
sponsorTimesSubmitting = [];
updatePreviewBar();
-
updateEditButtonsOnPlayer();
}
}
@@ -1413,6 +1416,7 @@ function dontShowNoticeAgain() {
* Helper method for the submission notice to clear itself when it closes
*/
function resetSponsorSubmissionNotice() {
+ submissionNotice?.close();
submissionNotice = null;
}