mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Fixed submitted sponsors and prevented preview sponsors from being voted on
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user