mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
FIX: Notes were not persistent
This commit is contained in:
parent
555819a9b0
commit
07f07d3d38
@ -63,8 +63,8 @@ export enum WalletTransactionsStatus {
|
||||
// @ts-ignore defaut value does not match the type
|
||||
export const BlueStorageContext = createContext<BlueStorageContextType>(undefined);
|
||||
export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
const txMetadata = useRef<TTXMetadata>(BlueApp.tx_metadata);
|
||||
const counterpartyMetadata = useRef<TCounterpartyMetadata>(BlueApp.counterparty_metadata || {}); // init
|
||||
const txMetadata = useRef<TTXMetadata>({});
|
||||
const counterpartyMetadata = useRef<TCounterpartyMetadata>({}); // init
|
||||
const getTransactions = BlueApp.getTransactions;
|
||||
const fetchWalletBalances = BlueApp.fetchWalletBalances;
|
||||
const fetchWalletTransactions = BlueApp.fetchWalletTransactions;
|
||||
@ -94,6 +94,8 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode })
|
||||
BlueElectrum.isDisabled().then(setIsElectrumDisabled);
|
||||
if (walletsInitialized) {
|
||||
setWallets(BlueApp.getWallets());
|
||||
txMetadata.current = BlueApp.tx_metadata;
|
||||
counterpartyMetadata.current = BlueApp.counterparty_metadata;
|
||||
BlueElectrum.connectMain();
|
||||
}
|
||||
}, [walletsInitialized]);
|
||||
|
@ -12,11 +12,12 @@ interface HeaderRightButtonProps {
|
||||
|
||||
const HeaderRightButton: React.FC<HeaderRightButtonProps> = ({ disabled = true, onPress, title, testID }) => {
|
||||
const { colors } = useTheme();
|
||||
const opacity = disabled ? 0.5 : 1;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
accessibilityRole="button"
|
||||
disabled={disabled}
|
||||
style={[styles.save, { backgroundColor: colors.lightButton }]}
|
||||
style={[styles.save, { backgroundColor: colors.lightButton }, { opacity }]}
|
||||
onPress={onPress}
|
||||
testID={testID}
|
||||
>
|
||||
|
@ -21,7 +21,7 @@ import Broadcast from '../screen/send/Broadcast';
|
||||
import IsItMyAddress from '../screen/send/isItMyAddress';
|
||||
import Success from '../screen/send/success';
|
||||
import CPFP from '../screen/transactions/CPFP';
|
||||
import TransactionDetails from '../screen/transactions/details';
|
||||
import TransactionDetails from '../screen/transactions/TransactionDetails';
|
||||
import RBFBumpFee from '../screen/transactions/RBFBumpFee';
|
||||
import RBFCancel from '../screen/transactions/RBFCancel';
|
||||
import TransactionStatus from '../screen/transactions/TransactionStatus';
|
||||
|
@ -103,9 +103,16 @@ const TransactionDetails = () => {
|
||||
}, [tx, txMetadata, memo, counterpartyLabel, paymentCode, saveToDisk, counterpartyMetadata]);
|
||||
|
||||
const HeaderRight = useMemo(
|
||||
() => <HeaderRightButton disabled={isLoading} onPress={handleOnSaveButtonTapped} title={loc.wallets.details_save} />,
|
||||
() =>
|
||||
tx && (
|
||||
<HeaderRightButton
|
||||
disabled={txMetadata[tx.hash].memo === memo}
|
||||
onPress={handleOnSaveButtonTapped}
|
||||
title={loc.wallets.details_save}
|
||||
/>
|
||||
),
|
||||
|
||||
[isLoading, handleOnSaveButtonTapped],
|
||||
[tx, txMetadata, memo, handleOnSaveButtonTapped],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
Loading…
Reference in New Issue
Block a user