mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Fixed new submissions getting added to the downloaded submissions.
This commit is contained in:
15
content.js
15
content.js
@@ -1041,6 +1041,9 @@ function submitSponsorTimes() {
|
||||
//update sponsorTimes
|
||||
chrome.storage.sync.set({[sponsorTimeKey]: sponsorTimes});
|
||||
|
||||
//update sponsorTimesSubmitting
|
||||
sponsorTimesSubmitting = sponsorTimes;
|
||||
|
||||
let confirmMessage = chrome.i18n.getMessage("submitCheck") + "\n\n" + getSponsorTimesMessage(sponsorTimes)
|
||||
+ "\n\n" + chrome.i18n.getMessage("confirmMSG") + "\n\n" + chrome.i18n.getMessage("guildlinesSummary");
|
||||
if(!confirm(confirmMessage)) return;
|
||||
@@ -1060,8 +1063,6 @@ function sendSubmitMessage(){
|
||||
|
||||
let currentVideoID = sponsorVideoID;
|
||||
|
||||
let currentSponsorTimes = submitSponsorTimes;
|
||||
|
||||
chrome.runtime.sendMessage({
|
||||
message: "submitTimes",
|
||||
videoID: currentVideoID
|
||||
@@ -1085,11 +1086,19 @@ function sendSubmitMessage(){
|
||||
|
||||
//clear the sponsor times
|
||||
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
|
||||
chrome.storage.sync.set({[sponsorTimeKey]: []}, () => void updatePreviewBar());
|
||||
chrome.storage.sync.set({[sponsorTimeKey]: []});
|
||||
|
||||
//add submissions to current sponsors list
|
||||
sponsorTimes = sponsorTimes.concat(sponsorTimesSubmitting);
|
||||
for (let i = 0; i < sponsorTimesSubmitting.length; i++) {
|
||||
// Add some random IDs
|
||||
UUIDs.push(generateUserID());
|
||||
}
|
||||
|
||||
// Empty the submitting times
|
||||
sponsorTimesSubmitting = [];
|
||||
|
||||
updatePreviewBar();
|
||||
} else {
|
||||
//show that the upload failed
|
||||
document.getElementById("submitButton").style.animation = "unset";
|
||||
|
||||
Reference in New Issue
Block a user