From d16f2ec0e40e11e811f151a9a5f80957407706c6 Mon Sep 17 00:00:00 2001 From: Jack Cuthbert Date: Mon, 2 Dec 2019 13:42:55 +1100 Subject: [PATCH] fix: invalid duration calculation Side note: tests are good, I should write them --- src/utils/slack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/slack.ts b/src/utils/slack.ts index a65dba7..a48ca47 100644 --- a/src/utils/slack.ts +++ b/src/utils/slack.ts @@ -29,7 +29,7 @@ export async function setSlackStatus (status: string, duration?: number) { profile: { status_text: status, status_emoji: status !== '' ? config.slack.emoji : '', - status_expiration: duration ?? 0 + status_expiration: duration !== undefined ? calcExpiration(duration) : 0 } }