From 98f910b831cb1288056cd3fe75c8441d13565c23 Mon Sep 17 00:00:00 2001 From: rupato-deriv <97010868+rupato-deriv@users.noreply.github.com> Date: Mon, 26 Feb 2024 19:49:51 +0800 Subject: [PATCH] Revert "Rpuato/test check post messages" --- src/components/Main/main.jsx | 5 ----- src/storage.js | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/components/Main/main.jsx b/src/components/Main/main.jsx index c4acdf21e..87728bdd1 100644 --- a/src/components/Main/main.jsx +++ b/src/components/Main/main.jsx @@ -92,25 +92,20 @@ const Main = () => { } loginAndSetTokens(token_list) .then(({ account_info = {} }) => { - console.log(account_info, '1st'); if (account_info?.loginid) { - console.log(account_info, '2nd'); dispatch(setLoginId(account_info?.loginid)); dispatch(updateIsLogged(true)); dispatch(updateActiveAccount(account_info)); applyToolboxPermissions(); syncWithDerivApp(); } else { - console.log(account_info, '3rd'); dispatch(updateIsLogged(false)); } }) .catch(() => { - console.log('6th'); dispatch(updateIsLogged(false)); }) .finally(() => { - console.log('5th'); resolve(); dispatch(setAccountSwitcherLoader(false)); }); diff --git a/src/storage.js b/src/storage.js index ac064cdf3..dc9f551ab 100644 --- a/src/storage.js +++ b/src/storage.js @@ -149,13 +149,10 @@ export const removeAllTokens = () => { export const isDone = varName => varName in store; export const syncWithDerivApp = () => { - console.log('syncWithDerivApp'); const iframe = document.getElementById('localstorage-sync'); const { origin } = getRelatedDeriveOrigin(); - console.log({ origin, client_acc: JSON.stringify(getClientAccounts()), active_login_id: getActiveLoginId() }); const postMessages = () => { - console.log('postMessages'); iframe.contentWindow.postMessage( { key: CLIENT_ACCOUNT, @@ -173,10 +170,8 @@ export const syncWithDerivApp = () => { }; if (iframe) { if (document.readyState === 'complete' || document.readyState === 'interactive') { - console.log(document.readyState); - setTimeout(() => { - postMessages(); - }, 100); + postMessages(); + return; } if (!hasReadystateListener) { hasReadystateListener = true;