Fixed submitted sponsors and prevented preview sponsors from being voted on

This commit is contained in:
Ajay Ramachandran
2020-04-04 23:35:44 -04:00
parent 55e17ceb60
commit f6945b56d8
3 changed files with 5 additions and 2 deletions

View File

@@ -184,7 +184,7 @@ function submitVote(type, UUID, callback) {
});
}
async function submitTimes(videoID, callback) {
async function submitTimes(videoID: string, callback) {
//get the video times from storage
let sponsorTimes = Config.config.sponsorTimes.get(videoID);
let userID = Config.config.userID;

View File

@@ -248,7 +248,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
sponsorTimesSubmitting[this.props.index].category = this.categoryOptionRef.current.value;
Config.config.sponsorTimes.set(this.props.contentContainer().sponsorVideoID, sponsorTimesSubmitting);
Config.config.sponsorTimes.set(this.props.contentContainer().sponsorVideoID, utils.getSegmentsFromSponsorTimes(sponsorTimesSubmitting));
this.props.contentContainer().updatePreviewBar();
}

View File

@@ -1308,6 +1308,9 @@ function vote(type, UUID, skipNotice?: SkipNoticeComponent) {
let sponsorIndex = utils.getSponsorIndexFromUUID(sponsorTimes, UUID);
// Don't vote for preview sponsors
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].UUID === null) return;
// See if the local time saved count and skip count should be saved
if (type == 0 && sponsorSkipped[sponsorIndex] || type == 1 && !sponsorSkipped[sponsorIndex]) {
let factor = 1;