Skip to content

fix(sample-app): for the loading status which did not return to false when the list of attachments or pinned messages was empty #2459

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

Conversation

sn4f
Copy link
Contributor

@sn4f sn4f commented Mar 16, 2024

🎯 Goal

The goal of this change is to fix a bug in the usePaginatedAttachments and usePaginatedPinnedMessages hooks. This bug caused the loading state to not be reset to false for empty lists. As a result, the empty list indicator could not be displayed.

🛠 Implementation details

The change consists of adding the following code to both hooks:
setLoading(false)

🧪 Testing

  1. Create a new chat without any messages.
  2. Open the screen with attachments or pinned messages.
  3. Notice that the empty state is not visible. This is because the loading state is still true even though there are no results and the data has finished loading from the API.

…t of attachments or pinned messages was empty
@sn4f sn4f changed the title Fix for the loading status which did not return to false when the list of attachments or pinned messages was empty fix: for the loading status which did not return to false when the list of attachments or pinned messages was empty Mar 16, 2024
@santhoshvai santhoshvai changed the title fix: for the loading status which did not return to false when the list of attachments or pinned messages was empty fix(sample-app): for the loading status which did not return to false when the list of attachments or pinned messages was empty Apr 1, 2024
@santhoshvai santhoshvai merged commit d99471a into GetStream:develop Apr 1, 2024
5 checks passed
@stream-ci-bot
Copy link
Contributor

🎉 This PR is included in version 5.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants