@@ -36,6 +36,7 @@ import { getWalletName } from '../../util/CurrencyWalletHelpers'
3636import { calculateSpamThreshold , unixToLocaleDateTime } from '../../util/utils'
3737import { SceneWrapper } from '../common/SceneWrapper'
3838import { withWallet } from '../hoc/withWallet'
39+ import { promptForContactsPermission } from '../modals/ContactsPermissionModal'
3940import { HeaderTitle } from '../navigation/HeaderTitle'
4041import { cacheStyles , useTheme } from '../services/ThemeContext'
4142import { ExplorerCard } from '../themed/ExplorerCard'
@@ -131,6 +132,13 @@ const TransactionListComponent: React.FC<Props> = props => {
131132 return out
132133 } , [ atEnd , isTransactionListUnsupported , transactions ] )
133134
135+ const hasNamedTransactions = React . useMemo ( ( ) => {
136+ return transactions . some ( transaction => {
137+ const metadataName = transaction . metadata ?. name
138+ return metadataName != null && metadataName . trim ( ) !== ''
139+ } )
140+ } , [ transactions ] )
141+
134142 // ---------------------------------------------------------------------------
135143 // Side-Effects
136144 // ---------------------------------------------------------------------------
@@ -142,6 +150,15 @@ const TransactionListComponent: React.FC<Props> = props => {
142150 }
143151 } , [ enabledTokenIds , navigation , tokenId ] )
144152
153+ useAsyncEffect (
154+ async ( ) => {
155+ if ( ! hasNamedTransactions ) return
156+ await dispatch ( promptForContactsPermission ( ) )
157+ } ,
158+ [ hasNamedTransactions ] ,
159+ 'TransactionListScene contacts permission'
160+ )
161+
145162 // Automatically navigate to the token activation confirmation scene if
146163 // the token appears in the unactivatedTokenIds list once the wallet loads
147164 // this state.
0 commit comments