Skip to content

Commit

Permalink
Fix bug system message being edited after delete
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Nov 20, 2023
1 parent ded3737 commit 3f9a987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/telegram/src/internal/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export abstract class Chat<
this.replySystemInProgress = { messageId, text };
const loopPromise = new Promise<void>(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;
Expand All @@ -177,6 +176,7 @@ export abstract class Chat<
} catch (editError) {
console.error({ messageId, editError });
}
await new Promise((resolve) => setTimeout(resolve, 1000));
}
resolve();
});
Expand Down

0 comments on commit 3f9a987

Please sign in to comment.