Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: refactor + don't show push notifications banner if wallet not conencted #2604

Closed
wants to merge 2 commits into from

Conversation

katspaugh
Copy link
Member

Also don't track banner dismissal on enable all/customize.

What it solves

The banner was previously shown regarless of whether you're connected which clashed with the onboard popup.

…n't track banner dismissal on enable all/customize
@katspaugh katspaugh requested a review from usame-algan October 9, 2023 08:35
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Branch preview

✅ Deploy successful!

https://banner--walletweb.review-wallet-web.5afe.dev

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link
Member

@usame-algan usame-algan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach of extracting some of the logic into local hooks. It would be nice to have tests for them, especially useShowBanner to make sure the change with the connected wallet works without manually testing it but I will approve the PR.

I've checked that the dismiss event only happens when the user closes the banner but not when enabling all or customizing. The other 2 events are still being sent correctly.

@katspaugh katspaugh changed the title Fix: don't show push notifications banner if wallet not conencted Fix: refactor + don't show push notifications banner if wallet not conencted Oct 9, 2023
@katspaugh
Copy link
Member Author

I won't be merging this because we need to release these and other fixes today, so I'll make a more focused PR with just the fixes.
@iamacook when you're back, please take a look and tell me what you think. I'd like us to follow this approach as a general rule.

@katspaugh katspaugh marked this pull request as draft October 9, 2023 09:51
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach.

We should fix/extend the current test to cover the added flag, as well as test the hooks in isolation.

Comment on lines +126 to +146
<CheckWallet>
{(isOk) => (
<div className={css.buttons}>
<Button
variant="contained"
size="small"
className={css.button}
onClick={onEnableAll}
disabled={!isOk}
>
Enable all
</Button>

<Link passHref href={{ pathname: AppRoutes.settings.notifications, query }} onClick={onCustomize}>
<Button variant="outlined" size="small" className={css.button}>
Customize
</Button>
</Link>
</div>
)}
</CheckWallet>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are no longer showing the banner when no wallet is connected, we don't need to wrap this in CheckWallet.

@katspaugh katspaugh closed this Oct 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2023
@katspaugh katspaugh deleted the banner branch October 27, 2023 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants