2
2
import { DrawerContentComponentProps , useDrawerStatus } from '@react-navigation/drawer'
3
3
import { DrawerActions } from '@react-navigation/native'
4
4
import { EdgeAccount , EdgeUserInfo } from 'edge-core-js'
5
+ import hashjs from 'hash.js'
5
6
import * as React from 'react'
6
7
import { Image , Platform , Pressable , ScrollView , View } from 'react-native'
7
8
import LinearGradient from 'react-native-linear-gradient'
@@ -28,7 +29,6 @@ import { config } from '../../theme/appConfig'
28
29
import { useDispatch , useSelector } from '../../types/reactRedux'
29
30
import { NavigationBase } from '../../types/routerTypes'
30
31
import { parseDeepLink } from '../../util/DeepLinkParser'
31
- import { base58ToUuid } from '../../util/utils'
32
32
import { IONIA_SUPPORTED_FIATS } from '../cards/VisaCardCard'
33
33
import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity'
34
34
import { ButtonsModal } from '../modals/ButtonsModal'
@@ -144,7 +144,12 @@ export function SideMenuComponent(props: DrawerContentComponentProps) {
144
144
145
145
const handleShareApp = ( ) => {
146
146
const message = `${ sprintf ( lstrings . share_subject , config . appName ) } \n\n${ lstrings . share_message } \n\n`
147
- const website = `${ config . website } ?af=appreferred-${ base58ToUuid ( context . clientId ) } `
147
+
148
+ // Generate anonymized referral ID
149
+ const data = Uint8Array . from ( Buffer . from ( account . rootLoginId , 'hex' ) )
150
+ const refId = hashjs . sha256 ( ) . update ( data ) . digest ( 'hex' ) . replace ( '0x' , '' ) . substring ( 0 , 10 )
151
+
152
+ const website = `${ config . website } ?af=appreferred_${ refId } `
148
153
149
154
const shareOptions = {
150
155
message : Platform . OS === 'ios' ? message : message + website ,
0 commit comments