File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments