Skip to content

Commit

Permalink
fix: add missing closeModalOld for the old way of usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Cussone committed Nov 6, 2024
1 parent e0669ce commit 6457371
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/connectors/argent/argentMobile/modal/argentModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ class ArgentModal {
})
}

// TODO - SK-47 - remove this
public closeModal(success?: boolean) {
const modal = this.standaloneConnectorModal
if (success) {
Expand All @@ -183,6 +182,19 @@ class ArgentModal {
}
}

// TODO - SK-47 - remove this
public closeModalOld(success?: boolean) {
if (success) {
this.overlay
?.querySelector("iframe")
?.contentWindow?.postMessage("argent-login.success", "*")
this.popupWindow?.postMessage("argent-login.success", "*")
this.closingTimeout = setTimeout(this.close, 3400)
} else {
this.close()
}
}

private showModal(urls: Urls, modalWallet: ModalWalletExtended) {
this.standaloneConnectorModal = new Modal({
target: getModalTarget(),
Expand Down
4 changes: 2 additions & 2 deletions src/connectors/argent/argentMobile/modal/starknet/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ export class StarknetAdapter
const chainId = this.formatChainId(this.chainId)
argentModal.showApprovalModal(request)
const response = await this.client.request({ topic, chainId, request })
argentModal.closeModal(true)
argentModal.closeModalOld(true)
return response
} catch (error) {
argentModal.closeModal()
argentModal.closeModalOld()
if (error instanceof Error) {
throw new Error(error.message)
}
Expand Down

0 comments on commit 6457371

Please sign in to comment.