Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/connectors/webwallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export class WebWalletConnector extends Connector {
approvalRequests: ApprovalRequest[]
sessionTypedData: TypedData
}) {
await this.ensureWallet()
if (!this._wallet) {
await this.ensureWallet()
}

if (!this._wallet) {
throw new ConnectorNotFoundError()
Expand Down Expand Up @@ -161,7 +163,9 @@ export class WebWalletConnector extends Connector {
}

async connect(_args: ConnectArgs = {}): Promise<ConnectorData> {
await this.ensureWallet()
if (!this._wallet) {
await this.ensureWallet()
}

if (!this._wallet) {
throw new ConnectorNotFoundError()
Expand Down Expand Up @@ -209,6 +213,10 @@ export class WebWalletConnector extends Connector {
async request<T extends RpcMessage["type"]>(
call: RequestFnCall<T>,
): Promise<RpcTypeToMessageMap[T]["result"]> {
if (!this._wallet) {
await this.ensureWallet()
}

if (!this._wallet) {
throw new ConnectorNotConnectedError()
}
Expand Down