Skip to content

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

3 participants