From c7994698f8f0c36ccdb536aa84f5fec861790844 Mon Sep 17 00:00:00 2001 From: Lim Jet <57783762+daoauth@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:54:18 +0900 Subject: [PATCH] Update Home.tsx --- packages/holder/src/pages/Home.tsx | 13 +++++++++---- packages/holder/src/utils/config.ts | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/holder/src/pages/Home.tsx b/packages/holder/src/pages/Home.tsx index 42063bf..ef88c86 100644 --- a/packages/holder/src/pages/Home.tsx +++ b/packages/holder/src/pages/Home.tsx @@ -17,7 +17,11 @@ import { useRecoilState } from 'recoil'; import { useProviderFS } from '../provider/file'; import { IAccount, walrusDidState } from '../recoil'; import { getGoogleloginInfo } from '../utils/getGoogleloginInfo'; -import { FILE_NAME_ACCOUNT, FILE_NAME_DID_DOCS, SALT_TEMP } from '../utils/config'; +import { + FILE_NAME_ACCOUNT, + FILE_NAME_DID_DOCS, + SALT_TEMP, +} from '../utils/config'; import { Account } from '../component/Account'; import { DidDocs } from '../component/DidDocs'; import { jwtToAddress } from '@mysten/zklogin'; @@ -84,10 +88,10 @@ export const Home = () => { Buffer.from(docs).toString('utf8'), ) as string[]; } - setWalrusState({ account, didDocs }); + setWalrusState({ account, didDocs }); } else { // temp - setShowLoginBtn(false) + setShowLoginBtn(false); const { id_token: jwt } = queryString.parse(location.hash) as { id_token: string; }; @@ -110,6 +114,7 @@ export const Home = () => { FILE_NAME_ACCOUNT, Buffer.from(JSON.stringify(account), 'utf8'), ); + setShowLoginBtn(true); navigate('/'); // temp } @@ -138,7 +143,7 @@ export const Home = () => { }} > - {!initialized && ( + {(!initialized || !showLoginBtn) && ( <> Loading diff --git a/packages/holder/src/utils/config.ts b/packages/holder/src/utils/config.ts index 8763bc2..242f874 100644 --- a/packages/holder/src/utils/config.ts +++ b/packages/holder/src/utils/config.ts @@ -1,4 +1,5 @@ export const FILE_NAME_ACCOUNT = 'account.json'; export const FILE_NAME_DID_DOCS = 'did-docs.json'; -export const REDIRECT_URL = 'https://4yju9x2wv34m3zpqg5dt1eaxvor0d0wpvett3rmebzy6xxrdvh.walrus.site'; +export const REDIRECT_URL = + 'https://4yju9x2wv34m3zpqg5dt1eaxvor0d0wpvett3rmebzy6xxrdvh.walrus.site'; export const SALT_TEMP = '1553493906625353164421699608680';