Skip to content

Commit

Permalink
hot fix (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmaayan authored Jul 23, 2024
1 parent 42f90da commit 0b7d07f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-garlics-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-core": patch
---

[Hot Fix] Pontem wallet version 2.6.7 does not include a URL prop
9 changes: 9 additions & 0 deletions packages/wallet-adapter-core/src/WalletCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
if (typeof window !== "undefined") {
scopePollingDetectionStrategy(() => {
const providerName = wallet.providerName || wallet.name.toLowerCase();
// Hot fix to manage Pontem wallet to not show duplications if user has the
// new standard version installed. Pontem uses "Pontem" wallet name for previous versions and
// "Pontem Wallet" with new version
if (providerName === "pontem") {
const existingStandardPontemWallet = this._standard_wallets.find(
(wallet) => wallet.name == "Pontem Wallet"
);
if (existingStandardPontemWallet) return false;
}
if (Object.keys(window).includes(providerName)) {
wallet.readyState = WalletReadyState.Installed;
wallet.provider = window[providerName as any];
Expand Down
1 change: 1 addition & 0 deletions packages/wallet-adapter-core/src/utils/walletSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function truncateAddress(address: string | undefined) {
export function isAptosConnectWallet(
wallet: WalletInfo | AnyAptosWallet | AptosStandardWallet
) {
if (!wallet.url) return false;
return wallet.url.startsWith(APTOS_CONNECT_BASE_URL);
}

Expand Down

0 comments on commit 0b7d07f

Please sign in to comment.