Properly added submissions to sponsor times when done.

This commit is contained in:
Ajay Ramachandran 2019-11-23 18:05:42 -05:00
parent 0a84dbd3a5
commit a66c7c8063

View file

@ -992,6 +992,8 @@ function sendSubmitMessage(){
let currentVideoID = sponsorVideoID;
let currentSponsorTimes = submitSponsorTimes;
chrome.runtime.sendMessage({
message: "submitTimes",
videoID: currentVideoID
@ -1015,10 +1017,11 @@ function sendSubmitMessage(){
//clear the sponsor times
let sponsorTimeKey = "sponsorTimes" + currentVideoID;
chrome.storage.sync.set({[sponsorTimeKey]: []});
chrome.storage.sync.set({[sponsorTimeKey]: []}, () => void updatePreviewBar());
//request the sponsors from the server again
sponsorsLookup(currentVideoID);
//add submissions to current sponsors list
sponsorTimes = sponsorTimes.concat(sponsorTimesSubmitting);
sponsorTimesSubmitting = [];
} else {
//show that the upload failed
document.getElementById("submitButton").style.animation = "unset";