Merge pull request #7438 from BlueWallet/bip47togglr

FIX: Toggle for BIP47 was not visible
This commit is contained in:
GLaDOS 2025-01-02 12:39:37 +00:00 committed by GitHub
commit 23f6905191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View File

@ -655,6 +655,8 @@
"bip47": {
"payment_code": "Payment Code",
"contacts": "Contacts",
"bip47_explain": "Reusable and shareable code",
"bip47_explain_subtitle": "BIP47",
"purpose": "Reusable and shareable code (BIP47)",
"pay_this_contact": "Pay this contact",
"rename_contact": "Rename contact",

View File

@ -166,11 +166,12 @@ const ReceiveDetails = () => {
}
}, [showConfirmedBalance]);
const isBIP47Enabled = wallet?.isBIP47Enabled();
const toolTipActions = useMemo(() => {
const action = CommonToolTipActions.PaymentsCode;
action.menuState = wallet?.isBIP47Enabled();
const action = { ...CommonToolTipActions.PaymentsCode };
action.menuState = isBIP47Enabled;
return [action];
}, [wallet]);
}, [isBIP47Enabled]);
const onPressMenuItem = useCallback(() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
@ -203,10 +204,9 @@ const ReceiveDetails = () => {
useEffect(() => {
wallet?.allowBIP47() &&
wallet?.isBIP47Enabled() &&
setOptions({
headerLeft: () => (wallet?.isBIP47Enabled() ? null : HeaderLeft),
headerRight: () => (wallet?.isBIP47Enabled() ? HeaderLeft : HeaderRight),
headerLeft: () => HeaderLeft,
headerRight: () => HeaderRight,
});
}, [HeaderLeft, HeaderRight, colors.foregroundColor, setOptions, wallet]);

View File

@ -215,7 +215,8 @@ export const CommonToolTipActions = {
},
PaymentsCode: {
id: keys.PaymentsCode,
text: loc.bip47.purpose,
text: loc.bip47.bip47_explain,
subtitle: loc.bip47.bip47_explain_subtitle,
icon: icons.PaymentsCode,
menuState: false,
},