Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message: Fix duplicates in the reply stack #324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

avo1kov
Copy link

@avo1kov avo1kov commented Dec 6, 2023

fixes #305

@@ -430,7 +430,10 @@ addActionHandler('focusMessage', (global, actions, payload): ActionReturnType =>

if (replyMessageId) {
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
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