hopperelec / DefinitionDash

https://definition-dash.vercel.app
Creative Commons Attribution Share Alike 4.0 International
1 stars 0 forks source link

Show points change indicator after answering a question correctly #1

Closed hopperelec closed 3 months ago

hopperelec commented 3 months ago

Usually, when a player answers a question correctly, their points are updated in the database and realtime before the user is redirected to the game page. As a result, the player's points are already up-to-date by the time the game page loads, meaning the points change indicator doesn't get shown. One way to fix this would be to store the last known points client-side (e.g: as a cookie or in local storage) and to display the points change indicator when the game page loads if the current value is different to that found in that store. This would also be useful for if the player reloads the page for whatever reason (e.g: if they get disconnected, or take a break), so that they can see what has happened to their points since they last viewed the page.

hopperelec commented 3 months ago

Just realised this isn't an issue anymore with the pane system 😅