Skip to content

Commit 53a2778

Browse files
committed
Tidy flush exit handling
1 parent 0087fe5 commit 53a2778

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/src/hooks/use-exit-handler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export const useExitHandler = ({
7676

7777
const flushed = flushAnalytics()
7878
if (flushed && typeof (flushed as Promise<void>).finally === 'function') {
79-
;(flushed as Promise<void>).finally(exitNow)
79+
const flushPromise = flushed as Promise<void>
80+
flushPromise.finally(exitNow)
8081
} else {
8182
exitNow()
8283
}
@@ -87,7 +88,8 @@ export const useExitHandler = ({
8788
const handleSigint = () => {
8889
const flushed = flushAnalytics()
8990
if (flushed && typeof (flushed as Promise<void>).finally === 'function') {
90-
;(flushed as Promise<void>).finally(exitNow)
91+
const flushPromise = flushed as Promise<void>
92+
flushPromise.finally(exitNow)
9193
} else {
9294
exitNow()
9395
}

0 commit comments

Comments
 (0)