Skip to content

Conversation

@RKBoss6
Copy link
Contributor

@RKBoss6 RKBoss6 commented Nov 28, 2025

When you favorite an app, the text inside the icon adds one favorite immediately, that is local and will not get pushed to the database. What this PR does is gives the illusion that the website is updating the favorites immediately, adding another layer of feedback that the user has favorited an app. This has been tested, and works with no problems.

Example: When I favorited an app before, the color fill of the heart icon would change, but not the number, since the database is not updating with every favorite. eg. (30 --> 30)

Now, if I favorite the app, the text goes from 30 --> 31, which instantly provides feedback that you indeed favorited the app, and the number has changed.
Hopefully this will help the website feel more snappy and efficient with favorite handling.

  • Add local favorites variable to keep track of favorites made in session
  • Add local saving so the added favorite doesn't disappear on refresh
  • Remove local favorite when database is updated

@RKBoss6 RKBoss6 marked this pull request as draft November 30, 2025 04:16
@RKBoss6
Copy link
Contributor Author

RKBoss6 commented Dec 1, 2025

The editor I'm using seems to have formatted the document differently than before, leading to a bit of a nightmare for maintainers... Hopefully I can get that fixed 🤞

@gfwilliams
Copy link
Member

Thanks! This looks good (apart from the maybe global variable favsThisSession?), but I really don't want all the random whitespace changes that are in there now!

If you could fix that I'd be happy to pull it in. I guess it might be easier for you to stop the editor messing it up, then just start from scratch and copy in the few lines of changes you made?

@RKBoss6
Copy link
Contributor Author

RKBoss6 commented Dec 1, 2025

Thanks! I think that's what I'll end up doing anyway - it's a bit of a mess right now.

@RKBoss6
Copy link
Contributor Author

RKBoss6 commented Dec 1, 2025

It's fixed now, and works well!

@RKBoss6 RKBoss6 marked this pull request as ready for review December 1, 2025 13:28
@gfwilliams
Copy link
Member

Looks great - thanks! Just merging

@gfwilliams gfwilliams merged commit 5436722 into espruino:master Dec 1, 2025
1 check passed
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.

2 participants