Skip to content

[READY] filter out Nova Wallet option if not in the Nova app#635

Merged
ebma merged 11 commits into
stagingfrom
545-check-flag-if-vortex-app-is-opened-in-nova-dapp-browser
May 15, 2025
Merged

[READY] filter out Nova Wallet option if not in the Nova app#635
ebma merged 11 commits into
stagingfrom
545-check-flag-if-vortex-app-is-opened-in-nova-dapp-browser

Conversation

@Sharqiewicz
Copy link
Copy Markdown
Member

@Sharqiewicz Sharqiewicz commented May 12, 2025

Show Nova Wallet connection option only when dApp is open in Nova app.

@Sharqiewicz Sharqiewicz linked an issue May 12, 2025 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2025

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 8f7135e
🔍 Latest deploy log https://app.netlify.com/sites/pendulum-pay/deploys/68249f995f082c00086fbe19
😎 Deploy Preview https://deploy-preview-635--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Sharqiewicz Sharqiewicz requested review from a team and Copilot May 12, 2025 15:20
@Sharqiewicz Sharqiewicz changed the title filter out Nova Wallet option if not in the Nova app [READY] filter out Nova Wallet option if not in the Nova app May 12, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR filters out the Nova Wallet connection option when the dApp is not opened in the Nova app.

  • Introduces a global declaration for window.walletExtension with the isNovaWallet property.
  • Adds helper functions filterNovaWallet and getFilteredWallets to control wallet visibility.
  • Replaces the direct wallet filtering logic with the new getFilteredWallets function.

Comment thread frontend/src/hooks/useConnectPolkadotWallet/index.tsx Outdated
Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Let's address the nit from copilot but rest looks good to me ✅

} else {
localStorage.setItem(BRLA_KYC_FORM_STORAGE_KEY, JSON.stringify({ taxId }));
}
}, [setValue, taxId]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we could ignore here reacting to taxId and setting? I think the effect bellow (with the subscription) should handle already setting the taxId, or do we need both effects for different scenarios?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The first useEffect is used for the form initialization with the data stored in the LocalStorage. I see it might look confusing so I reorganized the code in a better way now to reduce the cognitive load. let me know if it looks better for you now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes I was just confused about the else branch of the first one (where the storage is set), and the second useEffect that is also subscribed to changes to the form via watch. But I see now that the second one will set the storage not only when savedData doesn't exists but on any refresh of the form. Nevermind then, let's go!

@Sharqiewicz
Copy link
Copy Markdown
Member Author

Sentry timeout error failed the pipeline

@Sharqiewicz
Copy link
Copy Markdown
Member Author

@pendulum-chain/devs Can I merge?

Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

I tested a bit and seems to do what it's supposed to do. I think the localStorage logic is a bit scattered but I'm fine if we keep it that way.

@ebma ebma merged commit bc629d6 into staging May 15, 2025
5 checks passed
@ebma ebma deleted the 545-check-flag-if-vortex-app-is-opened-in-nova-dapp-browser branch May 15, 2025 16:08
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.

Check flag if vortex app is opened in Nova dapp browser

4 participants