Skip to content

Commit 1e723d2

Browse files
committed
fix: fix bug in isValidSession
1 parent 90b8857 commit 1e723d2

File tree

1 file changed

+3
-4
lines changed
  • src/connectors/argent/argentMobile/modal

1 file changed

+3
-4
lines changed

src/connectors/argent/argentMobile/modal/adapter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from "@walletconnect/utils"
1313
import { EventEmitter } from "events"
1414

15-
import { ProviderInterface } from "starknet"
15+
import type { ProviderInterface } from "starknet"
1616
import type { EthereumRpcConfig } from "./starknet/adapter"
1717

1818
export interface NamespaceAdapterOptions {
@@ -63,7 +63,7 @@ export abstract class NamespaceAdapter {
6363
requiredNamespaces,
6464
}: SessionTypes.Struct) => {
6565
const chain = this.formatChainId(this.chainId)
66-
if (requiredNamespaces) {
66+
if (requiredNamespaces && Object.keys(requiredNamespaces).length > 0) {
6767
return !!requiredNamespaces[this.namespace]?.chains?.includes(chain)
6868
}
6969
return !!namespaces?.[this.namespace]?.accounts.some((account) =>
@@ -97,8 +97,7 @@ export abstract class NamespaceAdapter {
9797

9898
protected setChainId(chain: string) {
9999
if (this.isCompatibleChainId(chain)) {
100-
const chainId = this.parseChainId(chain)
101-
this.chainId = chainId
100+
this.chainId = this.parseChainId(chain)
102101
this.eventEmitter.emit("chainChanged", this.chainId)
103102
}
104103
}

0 commit comments

Comments
 (0)