-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: getall is being called unnecessarily every time the user accesses the My Collection page #3681
Conversation
…re empty before calling getTypes to avoid unnecessary API calls ♻️ (typesStore.ts): Remove unnecessary useAlertStore setState call to improve code readability and maintainability
This pull request is automatically being deployed by Amplify Hosting (learn more). |
We still have other places that we call getTypes. Can you check them out too? |
The `getTypes` function in `typesStore.ts` has been updated to always force a refresh of the types data. This change ensures that the latest data is fetched from the API, avoiding unnecessary API calls.
yes, there's just another place, but Its already true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…s the My Collection page (langflow-ai#3681) * ✨ (use-get-folders.ts): Update useGetFoldersQuery to check if types are empty before calling getTypes to avoid unnecessary API calls ♻️ (typesStore.ts): Remove unnecessary useAlertStore setState call to improve code readability and maintainability * feat: Update getTypes function to always force refresh The `getTypes` function in `typesStore.ts` has been updated to always force a refresh of the types data. This change ensures that the latest data is fetched from the API, avoiding unnecessary API calls. * Changed types check in other pages --------- Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
This PR addresses an issue where the /getall endpoint was being called unnecessarily every time a user accessed the 'My Collection' page. This redundant API call could lead to increased load times and unnecessary server strain.
✨ (use-get-folders.ts): Update useGetFoldersQuery to check if types are empty before calling getTypes to avoid unnecessary API calls
♻️ (typesStore.ts): Remove unnecessary useAlertStore setState call to improve code readability and maintainability