From c4fa06d3e7ab92875fb75b1fcd5c8a301e7cf25b Mon Sep 17 00:00:00 2001 From: alina sireneva Date: Sun, 19 Jan 2025 01:52:48 +0300 Subject: [PATCH] fix: login with existing account --- packages/worker/src/worker/telegram.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/worker/src/worker/telegram.ts b/packages/worker/src/worker/telegram.ts index f61e6c2..11c589f 100644 --- a/packages/worker/src/worker/telegram.ts +++ b/packages/worker/src/worker/telegram.ts @@ -45,6 +45,7 @@ async function handleAuthSuccess(accountId: string, user: User) { const testMode = client.params.testMode ?? false if ($accounts.get().some(it => it.telegramId === user.id)) { + await client.close() await deleteAccount(accountId) throw new Error(`Account already exists (user ID: ${user.id})`) }