encryption
This commit is contained in:
+6
-2
@@ -5,7 +5,7 @@ import { ArrowDownLeft, ArrowLeftRight, ArrowRight, ArrowUpRight, BookOpen, Chec
|
||||
import { rarity } from '../shared/protocol.ts';
|
||||
import { CONSENSUS, NETWORK, isNftTrade, nftTransferMessage, testnetOwnerOf, transactionCardIds,
|
||||
type TestnetBlock, type TestnetSnapshot } from '../shared/testnet.ts';
|
||||
import { getWallet, sign, type Wallet } from './wallet.ts';
|
||||
import { getWallet, sign, subscribeWallet, watchWalletLifecycle, type Wallet } from './wallet.ts';
|
||||
import { Card, samples, imageCredit, type CardData } from './Card.tsx';
|
||||
import { WalletPanel } from './WalletPanel.tsx';
|
||||
import { useModalFocus } from './useModalFocus.ts';
|
||||
@@ -79,10 +79,14 @@ export default function App() {
|
||||
};
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
const stopLifecycle = watchWalletLifecycle();
|
||||
const unsubscribe = subscribeWallet(() => {
|
||||
void getWallet().then(value => { if(active) {setWallet(value);setRecipient('');setTransferError('');} }).catch(()=>{if(active)setWallet(undefined);});
|
||||
});
|
||||
getWallet().then(value => { if (active) setWallet(value); }).catch(e => { if (active) setError(message(e)); });
|
||||
void refresh().catch(() => {});
|
||||
const timer = setInterval(() => { void refresh().catch(() => {}); }, 8000);
|
||||
return () => { active = false; clearInterval(timer); refreshVersion.current++; };
|
||||
return () => { active = false; unsubscribe(); stopLifecycle(); clearInterval(timer); refreshVersion.current++; };
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (toast) { const timer = setTimeout(() => setToast(''), 8000); return () => clearTimeout(timer); }
|
||||
|
||||
Reference in New Issue
Block a user