Skip to content

Commit

Permalink
Update Home.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Sep 10, 2024
1 parent 8756f7d commit c799469
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions packages/holder/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
};
Expand All @@ -110,6 +114,7 @@ export const Home = () => {
FILE_NAME_ACCOUNT,
Buffer.from(JSON.stringify(account), 'utf8'),
);
setShowLoginBtn(true);
navigate('/');
// temp
}
Expand Down Expand Up @@ -138,7 +143,7 @@ export const Home = () => {
}}
>
<Stack spacing={2} alignItems="center">
{!initialized && (
{(!initialized || !showLoginBtn) && (
<>
<Typography>Loading</Typography>
<Box sx={{ width: '200px' }}>
Expand Down
3 changes: 2 additions & 1 deletion packages/holder/src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit c799469

Please sign in to comment.