Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Sep 29, 2022
1 parent 5686250 commit dec2a8f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/node/src/app/analytics-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ export class AnalyticsNode
this.once('drained', () => resolve())
}
})
if (timeout) {
return pTimeout(promise, timeout).catch(() => undefined)
} else {
return promise
}
return timeout ? pTimeout(promise, timeout).catch(() => undefined) : promise
}

private _dispatch(segmentEvent: CoreSegmentEvent, callback?: Callback) {
Expand Down

0 comments on commit dec2a8f

Please sign in to comment.