Skip to content

Commit

Permalink
Increase utxo fetch (#508)
Browse files Browse the repository at this point in the history
* update on opening popup

* add comment
  • Loading branch information
bordalix authored Dec 20, 2023
1 parent 265a362 commit 15b48a9
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions src/extension/wallet/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ import { SendFlowStep } from '../../../domain/repository';
import type { Asset } from 'marina-provider';
import { networks } from 'liquidjs-lib';
import { useStorageContext } from '../../context/storage-context';
import { UpdaterService } from '../../../application/updater';
import zkp from '@vulpemventures/secp256k1-zkp';

const Home: React.FC = () => {
const history = useHistory();
const { appRepository, sendFlowRepository, cache } = useStorageContext();
const {
walletRepository,
assetRepository,
blockHeadersRepository,
appRepository,
sendFlowRepository,
cache,
} = useStorageContext();
const [sortedAssets, setSortedAssets] = React.useState<Asset[]>([]);

useEffect(() => {
Expand Down Expand Up @@ -56,12 +65,26 @@ const Home: React.FC = () => {
});
};

const handleReceive = () => {
history.push(RECEIVE_SELECT_ASSET_ROUTE);
};
const handleReceive = () => history.push(RECEIVE_SELECT_ASSET_ROUTE);

const handleSend = () => history.push(SEND_SELECT_ASSET_ROUTE);

// update everytime the user comes back to home
// this also works when user re-opens the wallet
useEffect(() => {
(async () => {
const updater = new UpdaterService(
walletRepository,
appRepository,
blockHeadersRepository,
assetRepository,
await zkp()
);
if (!cache?.network) throw new Error('Network not found');
await updater.checkAndFixMissingTransactionsData(cache.network);
})().catch(console.error);
}, [cache?.authenticated]);

useEffect(() => {
(async () => {
const safeHistoryPush = (pathname: string) => {
Expand Down

0 comments on commit 15b48a9

Please sign in to comment.