From d9c913c265b7b257c4ba01eaffa387bd41d06128 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Sun, 26 May 2024 18:58:43 -0400 Subject: [PATCH] Update storage-context.tsx --- blue_modules/storage-context.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blue_modules/storage-context.tsx b/blue_modules/storage-context.tsx index 5940a751d..b6ac8156f 100644 --- a/blue_modules/storage-context.tsx +++ b/blue_modules/storage-context.tsx @@ -63,8 +63,8 @@ export enum WalletTransactionsStatus { // @ts-ignore defaut value does not match the type export const BlueStorageContext = createContext(undefined); export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) => { - const txMetadata = useRef({}); - const counterpartyMetadata = useRef({}); // init + const txMetadata = useRef(BlueApp.tx_metadata); + const counterpartyMetadata = useRef(BlueApp.counterparty_metadata || {}); // init const getTransactions = BlueApp.getTransactions; const fetchWalletBalances = BlueApp.fetchWalletBalances; const fetchWalletTransactions = BlueApp.fetchWalletTransactions; @@ -93,9 +93,9 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) useEffect(() => { BlueElectrum.isDisabled().then(setIsElectrumDisabled); if (walletsInitialized) { - setWallets(BlueApp.getWallets()); txMetadata.current = BlueApp.tx_metadata; counterpartyMetadata.current = BlueApp.counterparty_metadata; + setWallets(BlueApp.getWallets()); BlueElectrum.connectMain(); } }, [walletsInitialized]);