Skip to content

Commit ea72833

Browse files
author
Aleksandar Cakalic
committed
Merge branch 'refs/heads/develop' into beta
# Conflicts: # package.json
2 parents 342a490 + d0d4c8d commit ea72833

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/connectors/webwallet/helpers/openWebwallet.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ export const openWebwallet = async (
6060
const { allowedDapps } = await fetchAllowedDapps(network)
6161

6262
if (allowedDapps.includes(window.location.hostname)) {
63-
const modalId = "argent-webwallet-modal"
63+
const backdropId = "argent-webwallet-backdrop"
6464
const iframeId = "argent-webwallet-iframe"
6565

66-
const existingModal = document.getElementById(modalId)
66+
const existingBackdrop = document.getElementById(backdropId)
6767
const existingIframe = document.getElementById(iframeId)
6868

6969
// avoid duplicate iframes
70-
if (existingIframe && existingIframe && existingModal) {
70+
if (existingIframe && existingIframe && existingBackdrop) {
7171
existingIframe.remove()
72-
existingModal.remove()
72+
existingBackdrop.remove()
7373
}
7474
const { iframe, backdrop } = await createModal(origin, false)
7575

src/connectors/webwallet/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ export class WebWalletConnector extends Connector {
126126
approvalRequests: ApprovalRequest[]
127127
sessionTypedData: TypedData
128128
}) {
129-
await this.ensureWallet()
129+
if (!this._wallet) {
130+
await this.ensureWallet()
131+
}
130132

131133
if (!this._wallet) {
132134
throw new ConnectorNotFoundError()
@@ -161,7 +163,9 @@ export class WebWalletConnector extends Connector {
161163
}
162164

163165
async connect(_args: ConnectArgs = {}): Promise<ConnectorData> {
164-
await this.ensureWallet()
166+
if (!this._wallet) {
167+
await this.ensureWallet()
168+
}
165169

166170
if (!this._wallet) {
167171
throw new ConnectorNotFoundError()
@@ -209,6 +213,10 @@ export class WebWalletConnector extends Connector {
209213
async request<T extends RpcMessage["type"]>(
210214
call: RequestFnCall<T>,
211215
): Promise<RpcTypeToMessageMap[T]["result"]> {
216+
if (!this._wallet) {
217+
await this.ensureWallet()
218+
}
219+
212220
if (!this._wallet) {
213221
throw new ConnectorNotConnectedError()
214222
}

0 commit comments

Comments
 (0)