From 00365934945c17336e2570953a143ed2f18f2657 Mon Sep 17 00:00:00 2001 From: upalinski Date: Tue, 10 Dec 2024 17:12:31 +0300 Subject: [PATCH 1/3] log init data and hide wallet iframe completely --- apps/creator/src/cere-wallet/wallet-context.tsx | 2 ++ apps/viewer/src/cere-wallet/wallet-context.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/creator/src/cere-wallet/wallet-context.tsx b/apps/creator/src/cere-wallet/wallet-context.tsx index 9c0a441..44de890 100644 --- a/apps/creator/src/cere-wallet/wallet-context.tsx +++ b/apps/creator/src/cere-wallet/wallet-context.tsx @@ -17,6 +17,7 @@ export const useCereWallet = () => { export const CereWalletProvider = ({ children }: PropsWithChildren>) => { const { initDataRaw } = useLaunchParams() || {}; + console.log('initData: ', initDataRaw); const wallet = useMemo(() => { const wallet = new EmbedWallet({ @@ -36,6 +37,7 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); + document.getElementById('torusIframe').style.height = '0px'; }); }); }); diff --git a/apps/viewer/src/cere-wallet/wallet-context.tsx b/apps/viewer/src/cere-wallet/wallet-context.tsx index 112ce2b..8b70af7 100644 --- a/apps/viewer/src/cere-wallet/wallet-context.tsx +++ b/apps/viewer/src/cere-wallet/wallet-context.tsx @@ -17,6 +17,7 @@ export const useCereWallet = () => { export const CereWalletProvider = ({ children }: PropsWithChildren>) => { const { initDataRaw } = useLaunchParams() || {}; + console.log('initData: ', initDataRaw); const wallet = useMemo(() => { const wallet = new EmbedWallet({ @@ -36,6 +37,7 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); + document.getElementById('torusIframe').style.height = '0px'; }); }); }); From 5cbc2444f8b1b0010cdd4484c14048fa7470a752 Mon Sep 17 00:00:00 2001 From: upalinski Date: Tue, 10 Dec 2024 17:22:57 +0300 Subject: [PATCH 2/3] fix type chek --- apps/creator/src/cere-wallet/wallet-context.tsx | 5 ++++- apps/viewer/src/cere-wallet/wallet-context.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/creator/src/cere-wallet/wallet-context.tsx b/apps/creator/src/cere-wallet/wallet-context.tsx index 44de890..ee13764 100644 --- a/apps/creator/src/cere-wallet/wallet-context.tsx +++ b/apps/creator/src/cere-wallet/wallet-context.tsx @@ -37,7 +37,10 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); - document.getElementById('torusIframe').style.height = '0px'; + const walletIframe = document.getElementById('torusIframe') + if (walletIframe) { + walletIframe.style.height = '0px'; + } }); }); }); diff --git a/apps/viewer/src/cere-wallet/wallet-context.tsx b/apps/viewer/src/cere-wallet/wallet-context.tsx index 8b70af7..d19bb73 100644 --- a/apps/viewer/src/cere-wallet/wallet-context.tsx +++ b/apps/viewer/src/cere-wallet/wallet-context.tsx @@ -37,7 +37,10 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); - document.getElementById('torusIframe').style.height = '0px'; + const walletIframe = document.getElementById('torusIframe') + if (walletIframe) { + walletIframe.style.height = '0px'; + } }); }); }); From f22c3d63fb905b9a076f4a923b68de9878cb6744 Mon Sep 17 00:00:00 2001 From: upalinski Date: Tue, 10 Dec 2024 17:23:10 +0300 Subject: [PATCH 3/3] fix linter --- apps/creator/src/cere-wallet/wallet-context.tsx | 2 +- apps/viewer/src/cere-wallet/wallet-context.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/creator/src/cere-wallet/wallet-context.tsx b/apps/creator/src/cere-wallet/wallet-context.tsx index ee13764..dd05db5 100644 --- a/apps/creator/src/cere-wallet/wallet-context.tsx +++ b/apps/creator/src/cere-wallet/wallet-context.tsx @@ -37,7 +37,7 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); - const walletIframe = document.getElementById('torusIframe') + const walletIframe = document.getElementById('torusIframe'); if (walletIframe) { walletIframe.style.height = '0px'; } diff --git a/apps/viewer/src/cere-wallet/wallet-context.tsx b/apps/viewer/src/cere-wallet/wallet-context.tsx index d19bb73..c19884a 100644 --- a/apps/viewer/src/cere-wallet/wallet-context.tsx +++ b/apps/viewer/src/cere-wallet/wallet-context.tsx @@ -37,7 +37,7 @@ export const CereWalletProvider = ({ children }: PropsWithChildren { console.log('Cere Wallet details: ', user); - const walletIframe = document.getElementById('torusIframe') + const walletIframe = document.getElementById('torusIframe'); if (walletIframe) { walletIframe.style.height = '0px'; }