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

fix: animate twice when sending message #362

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

hfdem
Copy link
Contributor

@hfdem hfdem commented Aug 11, 2024

setMessages((prevMsg) => {
const { ...message } = prevMsg[index];
message.local = false;
message.id = id;
message.timestamp = timestamp;
prevMsg[index] = message;
return [...prevMsg];
});

The above function causes the animation to be applied twice when sending a message successfully. This fix determines whether animation is allowed based on whether local is true or false.

Fix #130 (comment)

Copy link

sonarcloud bot commented Aug 11, 2024

@muke1908 muke1908 merged commit e247345 into muke1908:master Aug 12, 2024
3 checks passed
@hfdem hfdem deleted the patch-animate branch August 12, 2024 19:14
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.

Animate when new message appears
2 participants