Skip to content

Commit 44d4dd5

Browse files
committed
return undefined instead of resolving void
1 parent 27bb604 commit 44d4dd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,11 +2089,11 @@ async function vote(type: number, UUID: SegmentUUID, category?: Category, skipNo
20892089
return response;
20902090
}
20912091

2092-
async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse> {
2092+
async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse | undefined> {
20932093
const sponsorIndex = utils.getSponsorIndexFromUUID(sponsorTimes, UUID);
20942094

20952095
// Don't vote for preview sponsors
2096-
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) Promise.resolve();
2096+
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) return Promise.resolve(undefined);
20972097

20982098
// See if the local time saved count and skip count should be saved
20992099
if (type === 0 && sponsorSkipped[sponsorIndex] || type === 1 && !sponsorSkipped[sponsorIndex]) {

0 commit comments

Comments
 (0)