Closed ryanmio closed 9 months ago
Name | Link |
---|---|
Latest commit | 0fd0200c589c346577db0dd9de75e0a594becd46 |
Latest deploy log | https://app.netlify.com/sites/decode-me/deploys/65c18182a10c7100082143b5 |
Deploy Preview | https://deploy-preview-73--decode-me.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This commit addresses an issue where the CustomInstructionsIndicator component was not updating in response to changes made for the "Play Similar" feature. Previously, the component did not react to updates in local storage that indicate the user's choice to play similar scripts, especially after a game was over. This was due to the component not listening for custom events that signal such changes.
Changes made include:
Implementing a custom event dispatch in the usePlaySimilar hook. This event is fired whenever the "Play Similar" feature is activated, and local storage is updated with the selected script and the indication to play similar scripts.
Adding an event listener in the CustomInstructionsIndicator component for the custom event. This listener updates the component's state based on the event's detail, ensuring that the component re-renders with the correct information.
Ensuring cleanup of the event listener on component unmount to prevent memory leaks.
With these changes, the CustomInstructionsIndicator now correctly reflects the user's intent to play similar scripts, enhancing the user experience by providing relevant custom instructions.