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

Infinite loader displayed when messagesLoaded is true #455

Closed
despatates opened this issue May 29, 2023 · 2 comments
Closed

Infinite loader displayed when messagesLoaded is true #455

despatates opened this issue May 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@despatates
Copy link

First, thank you for your amazing plugin!

Describe the bug

When the server returns an empty list of messages, the message window shows a message No messages for the first room, but shows an infinite loader for the others.

Steps to reproduce

Here is a repo to reproduce the issue: https://github.com/despatates/vue-advanced-chat-sandbox

Starting with messages = [] and messagesLoaded = false.
I simulate an empty response from the server by setting messagesLoaded = true.
When I select another chat room, the infinite loader remains visible.

Expected behavior

The message window should display No messages if the server returns an empty list of messages.

Screenshots

vue-advanced-chat-sandbox

Device (please complete the following information)

  • OS: Fedora 38
  • Browser: Chrome 113.0.5672.126, Firefox 113.0.1
  • Package version: 2.0.7
@despatates despatates added the bug Something isn't working label May 29, 2023
@despatates
Copy link
Author

Hmm, I think I found the solution by writing this issue.

messagesLoaded must be reset to false before requesting the messages for the newly selected room. Thus it will reset the "loading state" of the message window. And eventually set it back to true when the messages are loaded.

Am I right?

@antoine92190
Copy link
Collaborator

Yep that's exactly right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants