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

133/favourtie button state #134

Merged
merged 3 commits into from
Nov 13, 2024
Merged

133/favourtie button state #134

merged 3 commits into from
Nov 13, 2024

Conversation

nichgalzin
Copy link
Contributor

Description

Closes #133

This PR adds a fetch to get the users favourite ids from the db to allow the ManageFavourite button to check if the popup window is already favourited by the user, thus keeping the UI up to date.

Files changed

ManageFavouritesButton.tsx- Adds useEffect that call message handler to fetch user Favourites, and updates local state.
displayPopup.ts- fixes util type error to correctly pass popup id

Copy link
Contributor

@camelPhonso camelPhonso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 👌

I was tempted to suggest moving the evaluation out and just passing a boolean, but this would be more complex in the event alarm listener so this actually feels like the better option

@camelPhonso camelPhonso merged commit c93dc9a into dev Nov 13, 2024
1 check passed
@camelPhonso camelPhonso deleted the 133/favourtie-button-state branch November 13, 2024 11:45
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.

Have favourite button display correct state if popup is already save in user data
2 participants