From fa866f1d29e92c738b993650a2c61e5e3dfb5dad Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 11 Jan 2023 23:08:30 +0800 Subject: [PATCH] Make function more clear --- packages/import-handler/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/import-handler/src/index.ts b/packages/import-handler/src/index.ts index dbce23fbc..4c5957765 100644 --- a/packages/import-handler/src/index.ts +++ b/packages/import-handler/src/index.ts @@ -191,10 +191,10 @@ const handleEvent = async (data: StorageEvent) => { await handler(ctx, stream) - if (ctx.countImported <= 1) { - await sendImportFailedEmail(userId) - } else { + if (ctx.countImported > 0) { await sendImportCompletedEmail(userId, ctx.countImported, ctx.countFailed) + } else { + await sendImportFailedEmail(userId) } } }