diff --git a/packages/use-wallet/src/wallets/pera.ts b/packages/use-wallet/src/wallets/pera.ts index f83f0fd2..4637833a 100644 --- a/packages/use-wallet/src/wallets/pera.ts +++ b/packages/use-wallet/src/wallets/pera.ts @@ -44,6 +44,19 @@ export class PeraWallet extends BaseWallet { super({ id, metadata, getAlgodClient, store, subscribe, networks }) this.options = options this.store = store + + const isPeraDiscover = window.navigator.userAgent.includes('pera') + + if (isPeraDiscover) { + this.logger.info('Pera Discover browser detected, auto connecting...') + void this.connect() + .then(() => { + this.logger.info('Auto-connect successful') + }) + .catch((error) => { + this.logger.warn('Auto-connect failed:', error.message) + }) + } } static defaultMetadata = { diff --git a/packages/use-wallet/src/wallets/pera2.ts b/packages/use-wallet/src/wallets/pera2.ts index a28335e0..2cc4d871 100644 --- a/packages/use-wallet/src/wallets/pera2.ts +++ b/packages/use-wallet/src/wallets/pera2.ts @@ -53,6 +53,19 @@ export class PeraWallet extends BaseWallet { } this.options = options this.store = store + + const isPeraDiscover = window.navigator.userAgent.includes('pera') + + if (isPeraDiscover) { + this.logger.info('Pera Discover browser detected, auto connecting...') + void this.connect() + .then(() => { + this.logger.info('Auto-connect successful') + }) + .catch((error) => { + this.logger.warn('Auto-connect failed:', error.message) + }) + } } static defaultMetadata = {