Conversation
Summary of ChangesHello @PanchoBubble, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on cleaning up the application by deprecating and removing the Tari ASIC promotional modal UI. It also refines the state management logic responsible for automatically displaying this modal, making its appearance more prompt and its activation conditions more straightforward. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request removes the old TariASICModal and its associated styles, and updates the useASICModalStore to manage the auto-opening of the new ASICPromoModal. While the removal of old components is good for cleanup, the refactoring of the initAutoOpen function in the store introduces a critical logical flaw that will cause the promo modal to auto-open repeatedly. Additionally, the presence of redundant state variables and commented-out code indicates incomplete refactoring.
| // const { hasAutoOpened, isClient } = get(); | ||
| const { isOpen } = get(); |
There was a problem hiding this comment.
The initAutoOpen function's new logic for determining when to auto-open the modal is missing a crucial check. Previously, the hasAutoOpened state and a localStorage item (ASIC_PROMO_KEY) were used to ensure the modal only appeared once per user. The current if (!isOpen) condition will cause the modal to auto-open every time initAutoOpen is called if the modal is not already open, regardless of whether the user has seen and closed it before. This will lead to a repetitive and poor user experience.
| // const { hasAutoOpened, isClient } = get(); | |
| const { isOpen } = get(); | |
| const { hasAutoOpened } = get(); | |
| const hasBeenShown = localStorage.getItem(ASIC_PROMO_KEY); |
| if (!isOpen) { | ||
| setTimeout(() => { | ||
| set({ isOpen: true, hasAutoOpened: true }); | ||
| localStorage.setItem(ASIC_PROMO_KEY, 'true'); | ||
| }, 1000); | ||
| } |
There was a problem hiding this comment.
This block implements the new auto-open logic, but it currently only checks !isOpen. To prevent the modal from repeatedly appearing, it needs to incorporate the hasAutoOpened state and the hasBeenShown status from localStorage (as defined in the previous suggestion). Without these checks, the modal will continuously re-appear, which is likely not the intended behavior for a promo.
| if (!isOpen) { | |
| setTimeout(() => { | |
| set({ isOpen: true, hasAutoOpened: true }); | |
| localStorage.setItem(ASIC_PROMO_KEY, 'true'); | |
| }, 1000); | |
| } | |
| if (!hasAutoOpened && !hasBeenShown) { | |
| setTimeout(() => { | |
| set({ isOpen: true, hasAutoOpened: true }); | |
| localStorage.setItem(ASIC_PROMO_KEY, 'true'); | |
| }, 1000); | |
| } |
| // if (!isClient) { | ||
| // set({ isClient: true }); | ||
| // } | ||
| // | ||
| // if (!hasAutoOpened && isClient) { | ||
| // const hasBeenShown = localStorage.getItem(ASIC_PROMO_KEY); | ||
| // | ||
| // if (!hasBeenShown) { | ||
| // setTimeout(() => { | ||
| // set({ isOpen: true, hasAutoOpened: true }); | ||
| // localStorage.setItem(ASIC_PROMO_KEY, 'true'); | ||
| // }, 1000); | ||
| // } | ||
| // | ||
| // set({ hasAutoOpened: true }); |
No description provided.