Skip to content

Conversation

@avo1kov
Copy link

@avo1kov avo1kov commented Dec 6, 2023

fixes #305

const replyStack = selectReplyStack(global, chatId, threadId, tabId) || [];
global = replaceTabThreadParam(global, chatId, threadId, 'replyStack', [...replyStack, replyMessageId], tabId);

if (replyMessageId !== replyStack[replyStack.length - 1]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if replyStack is an empty array?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the condition will not be satisfied because replyStack[-1] equals undefined, and this does not cause any errors to be thrown.

Copy link
Contributor

@zubiden zubiden Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking between several replies adds them to the reply stack without any limits
image

Copy link
Contributor

@korenskoy korenskoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Please update the pr title to "Message: Fix duplicates in the reply stack"

@avo1kov avo1kov changed the title fix: duplicates in Reply stack Message: Fix duplicates in the reply stack Jan 9, 2024
@avo1kov avo1kov force-pushed the fix-duplicates-in-reply-stack branch from f1a656a to 396e6e0 Compare October 3, 2024 12:49
@netlify
Copy link

netlify bot commented Oct 3, 2024

👷 Deploy request for telegram-tt-previews pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 396e6e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Floating Action Buttons: Duplicates in Reply stack

3 participants