From 3f9a987bf72ce7837e3e427385beb7a4959ca7e3 Mon Sep 17 00:00:00 2001 From: Dao Hoang Son Date: Tue, 21 Nov 2023 00:00:58 +0700 Subject: [PATCH] Fix bug system message being edited after delete --- packages/telegram/src/internal/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/telegram/src/internal/chat.ts b/packages/telegram/src/internal/chat.ts index b95a71d..10779c6 100644 --- a/packages/telegram/src/internal/chat.ts +++ b/packages/telegram/src/internal/chat.ts @@ -158,7 +158,6 @@ export abstract class Chat< this.replySystemInProgress = { messageId, text }; const loopPromise = new Promise(async (resolve) => { while (this.replySystemInProgress?.text === text) { - await new Promise((resolve) => setTimeout(resolve, 1000)); const elapsedInSeconds = Math.floor((Date.now() - startedAt) / 1000); if (elapsedInSeconds < 3) { continue; @@ -177,6 +176,7 @@ export abstract class Chat< } catch (editError) { console.error({ messageId, editError }); } + await new Promise((resolve) => setTimeout(resolve, 1000)); } resolve(); });