From 9b1f1a17027f8e818cd718ce10a7045b79ca735f Mon Sep 17 00:00:00 2001 From: bluecco Date: Mon, 8 Apr 2024 18:22:14 +0200 Subject: [PATCH] fix: force trpc subscribe using apply --- .../getWebWalletStarknetObject.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts b/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts index c2cca54..6acf6c4 100644 --- a/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts +++ b/src/connectors/webwallet/starknetWindowObject/getWebWalletStarknetObject.ts @@ -45,20 +45,24 @@ export const getWebWalletStarknetObject = async ( if (iframeProps) { const { iframe, modal } = iframeProps - proxyLink.updateModal.subscribe(undefined, { - onData(modalEvent: ModalEvents) { - switch (modalEvent.action) { - case "show": - showModal(modal) - break - case "hide": - hideModal(modal) - break - case "updateHeight": - setIframeHeight(iframe, modalEvent.height) - } + + proxyLink.updateModal.subscribe.apply(null, [ + undefined, + { + onData(modalEvent: ModalEvents) { + switch (modalEvent.action) { + case "show": + showModal(modal) + break + case "hide": + hideModal(modal) + break + case "updateHeight": + setIframeHeight(iframe, modalEvent.height) + } + }, }, - }) + ]) } return starknetWindowObject