mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
Update storage-context.tsx
This commit is contained in:
parent
07f07d3d38
commit
d9c913c265
1 changed files with 3 additions and 3 deletions
|
@ -63,8 +63,8 @@ export enum WalletTransactionsStatus {
|
||||||
// @ts-ignore defaut value does not match the type
|
// @ts-ignore defaut value does not match the type
|
||||||
export const BlueStorageContext = createContext<BlueStorageContextType>(undefined);
|
export const BlueStorageContext = createContext<BlueStorageContextType>(undefined);
|
||||||
export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) => {
|
export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) => {
|
||||||
const txMetadata = useRef<TTXMetadata>({});
|
const txMetadata = useRef<TTXMetadata>(BlueApp.tx_metadata);
|
||||||
const counterpartyMetadata = useRef<TCounterpartyMetadata>({}); // init
|
const counterpartyMetadata = useRef<TCounterpartyMetadata>(BlueApp.counterparty_metadata || {}); // init
|
||||||
const getTransactions = BlueApp.getTransactions;
|
const getTransactions = BlueApp.getTransactions;
|
||||||
const fetchWalletBalances = BlueApp.fetchWalletBalances;
|
const fetchWalletBalances = BlueApp.fetchWalletBalances;
|
||||||
const fetchWalletTransactions = BlueApp.fetchWalletTransactions;
|
const fetchWalletTransactions = BlueApp.fetchWalletTransactions;
|
||||||
|
@ -93,9 +93,9 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode })
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
BlueElectrum.isDisabled().then(setIsElectrumDisabled);
|
BlueElectrum.isDisabled().then(setIsElectrumDisabled);
|
||||||
if (walletsInitialized) {
|
if (walletsInitialized) {
|
||||||
setWallets(BlueApp.getWallets());
|
|
||||||
txMetadata.current = BlueApp.tx_metadata;
|
txMetadata.current = BlueApp.tx_metadata;
|
||||||
counterpartyMetadata.current = BlueApp.counterparty_metadata;
|
counterpartyMetadata.current = BlueApp.counterparty_metadata;
|
||||||
|
setWallets(BlueApp.getWallets());
|
||||||
BlueElectrum.connectMain();
|
BlueElectrum.connectMain();
|
||||||
}
|
}
|
||||||
}, [walletsInitialized]);
|
}, [walletsInitialized]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue