mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
wip
This commit is contained in:
parent
e91a24da85
commit
84242c03ec
@ -24,7 +24,7 @@ const useHandoffListener = () => {
|
||||
const handleUserActivity = useCallback(
|
||||
(data: UserActivityData) => {
|
||||
const { activityType, userInfo } = data;
|
||||
|
||||
try {
|
||||
if (activityType === HandOffActivityType.ReceiveOnchain) {
|
||||
navigate('ReceiveDetailsRoot', {
|
||||
screen: 'ReceiveDetails',
|
||||
@ -38,6 +38,9 @@ const useHandoffListener = () => {
|
||||
} else {
|
||||
console.debug(`Unhandled activity type: ${activityType}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error handling user activity:', error);
|
||||
}
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
@ -45,14 +48,14 @@ const useHandoffListener = () => {
|
||||
useEffect(() => {
|
||||
if (!walletsInitialized || !isHandOffUseEnabled) return;
|
||||
|
||||
const activitySubscription = eventEmitter.addListener('onUserActivityOpen', handleUserActivity);
|
||||
const activitySubscription = eventEmitter?.addListener('onUserActivityOpen', handleUserActivity);
|
||||
|
||||
EventEmitter.getMostRecentUserActivity?.()
|
||||
.then(handleUserActivity)
|
||||
.catch(() => console.debug('No userActivity object sent'));
|
||||
|
||||
return () => {
|
||||
activitySubscription.remove();
|
||||
activitySubscription?.remove();
|
||||
};
|
||||
}, [walletsInitialized, isHandOffUseEnabled, handleUserActivity]);
|
||||
};
|
||||
|
@ -499,9 +499,10 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
||||
)}
|
||||
</FContainer>
|
||||
{wallet?.chain === Chain.ONCHAIN && wallet.type !== MultisigHDWallet.type && wallet.getXpub && wallet.getXpub() ? (
|
||||
<Button
|
||||
onPress={() => navigation.navigate('WalletXpub', { walletID: wallet.getID(), xpub: wallet.getXpub() })}
|
||||
title={loc.wallets.view_xpub}
|
||||
<HandOffComponent
|
||||
title={wallet.getLabel()}
|
||||
type={HandOffActivityType.Xpub}
|
||||
url={`https://www.blockonomics.co/#/search?q=${wallet.getXpub()}`}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
|
Loading…
Reference in New Issue
Block a user