aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichael C <[email protected]>2022-10-21 02:41:01 -0400
committerMichael C <[email protected]>2022-10-21 02:41:01 -0400
commit44d4dd54aaeecff1ae31874898b4839cf53735a4 (patch)
treef14a2dd26677292dd43afa96c17f90ae5db7b453
parent27bb6045bcbe0ef831d42afdd4d1675de43e5918 (diff)
downloadSponsorBlock-44d4dd54aaeecff1ae31874898b4839cf53735a4.tar.gz
SponsorBlock-44d4dd54aaeecff1ae31874898b4839cf53735a4.zip
return undefined instead of resolving void
-rw-r--r--src/content.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content.ts b/src/content.ts
index 7df4dd93..7c68fe02 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2089,11 +2089,11 @@ async function vote(type: number, UUID: SegmentUUID, category?: Category, skipNo
return response;
}
-async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse> {
+async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse | undefined> {
const sponsorIndex = utils.getSponsorIndexFromUUID(sponsorTimes, UUID);
// Don't vote for preview sponsors
- if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) Promise.resolve();
+ if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) return Promise.resolve(undefined);
// See if the local time saved count and skip count should be saved
if (type === 0 && sponsorSkipped[sponsorIndex] || type === 1 && !sponsorSkipped[sponsorIndex]) {