Skip to content

Commit

Permalink
fix: only notify on multiple providers
Browse files Browse the repository at this point in the history
  • Loading branch information
donnyquixotic committed Jul 26, 2023
1 parent 5423535 commit 6cc02cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/i18n/en-us/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
walletconnect: 'WalletConnect',
connect_your_wallet: 'Connect Your Wallet',
wallet_introduction: 'What is a Web Wallet?',
no_provider_notification_message: 'No wallet provider was detected. Make sure you have the wallet installed and enabled. If you have multiple wallets installed, you can disable the others to avoid possible conflicts.',
multiple_providers_notification_message: 'Multiple providers detected. Disable all providers except MetaMask to continue.',
no_provider_action_label: 'Install {provider}',
no_injected_provider_found: '{providerName}\'s provider was not found.',
},
Expand Down
8 changes: 5 additions & 3 deletions src/pages/home/ConnectWalletOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default defineComponent({
};
const notifyNoProvider = (provider:string) => {
const message = globalProps.$t('home.no_provider_notification_message');
const message = globalProps.$t('home.multiple_providers_notification_message');
ant.config.notifyFailureWithAction(message, {
label: ant.config.localizationHandler('home.no_provider_action_label', { provider }),
handler: () => {
Expand All @@ -113,6 +113,8 @@ export default defineComponent({
setSafepalAuthenticator,
setWalletConnectAuthenticator,
notifyNoProvider,
redirectToMetamaskDownload,
redirectToSafepalDownload,
};
},
});
Expand All @@ -134,7 +136,7 @@ export default defineComponent({
</div>

<!-- Metamask Authenticator button -->
<div class="wallet-options__option" @click="supportsMetamask ? setMetamaskAuthenticator() : notifyNoProvider('Metamask')">
<div class="wallet-options__option" @click="supportsMetamask ? setMetamaskAuthenticator() : supportsSafePal ? notifyNoProvider('Metamask') : redirectToMetamaskDownload()">
<template v-if="isLoading('Metamask.login')">
<div class="wallet-options__loading"><QSpinnerFacebook /></div>
</template>
Expand All @@ -150,7 +152,7 @@ export default defineComponent({
</div>

<!-- Safepal Authenticator button -->
<div class="wallet-options__option" @click="supportsSafePal ? setSafepalAuthenticator() : notifyNoProvider('SafePal')">
<div class="wallet-options__option" @click="supportsSafePal ? setSafepalAuthenticator() : redirectToSafepalDownload()">
<template v-if="isLoading('SafePal.login')">
<div class="wallet-options__loading"><QSpinnerFacebook /></div>
</template>
Expand Down

0 comments on commit 6cc02cf

Please sign in to comment.