From 25a96e640350a6a40d42aaa4e2fb7d8716e53e87 Mon Sep 17 00:00:00 2001 From: Gabriel Masclef Date: Mon, 25 Jul 2022 12:22:38 -0300 Subject: [PATCH] Feat: segment events for view key/wallet --- src/navigation/wallet/screens/KeyOverview.tsx | 5 +++++ src/navigation/wallet/screens/WalletDetails.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/navigation/wallet/screens/KeyOverview.tsx b/src/navigation/wallet/screens/KeyOverview.tsx index cbf39e1c6..3f2b1cb3a 100644 --- a/src/navigation/wallet/screens/KeyOverview.tsx +++ b/src/navigation/wallet/screens/KeyOverview.tsx @@ -63,6 +63,7 @@ import EncryptPasswordDarkModeImg from '../../../../assets/img/tinyicon-encrypt- import {useTranslation} from 'react-i18next'; import {toFiat} from '../../../store/wallet/utils/wallet'; import _ from 'lodash'; +import {logSegmentEvent} from '../../../store/app/app.effects'; LogBox.ignoreLogs([ 'Non-serializable values were found in the navigation state', @@ -429,6 +430,10 @@ const KeyOverview: React.FC = ({navigation, route}) => { } }, [navigation, key?.wallets, context]); + useEffect(() => { + dispatch(logSegmentEvent('track', 'View Key')); + }, []); + const {wallets = [], totalBalance} = useAppSelector(({WALLET}) => WALLET.keys[id]) || {}; diff --git a/src/navigation/wallet/screens/WalletDetails.tsx b/src/navigation/wallet/screens/WalletDetails.tsx index 535e87bd2..73117b2a6 100644 --- a/src/navigation/wallet/screens/WalletDetails.tsx +++ b/src/navigation/wallet/screens/WalletDetails.tsx @@ -508,6 +508,11 @@ const WalletDetails: React.FC = ({route}) => { loadHistoryRef.current = loadHistory; useEffect(() => { + dispatch( + logSegmentEvent('track', 'View Wallet', { + coin: fullWalletObj?.currencyAbbreviation, + }), + ); dispatch(startUpdateWalletStatus({key, wallet: fullWalletObj})); setNeedActionTxps(pendingTxps); const subscription = DeviceEventEmitter.addListener(