@@ -2,10 +2,10 @@ import {FlashList} from '@shopify/flash-list';
22import type { ListRenderItemInfo } from '@shopify/flash-list' ;
33import React from 'react' ;
44import { View } from 'react-native' ;
5+ import type { OnyxEntry } from 'react-native-onyx' ;
56import Button from '@components/Button' ;
67import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
78import OfflineWithFeedback from '@components/OfflineWithFeedback' ;
8- import RenderHTML from '@components/RenderHTML' ;
99import ScreenWrapper from '@components/ScreenWrapper' ;
1010import Text from '@components/Text' ;
1111import useLocalize from '@hooks/useLocalize' ;
@@ -15,13 +15,19 @@ import {clearRevokeError, revokeDevice} from '@libs/actions/User';
1515import Navigation from '@libs/Navigation/Navigation' ;
1616import { getDeviceLogins , getLastLogin , getLoginKey } from '@libs/UserUtils' ;
1717import ONYXKEYS from '@src/ONYXKEYS' ;
18+ import type { Credentials } from '@src/types/onyx' ;
1819import type { Login } from '@src/types/onyx/Logins' ;
1920
21+ function autoGeneratedLoginSelector ( credentials : OnyxEntry < Credentials > ) {
22+ return credentials ?. autoGeneratedLogin ;
23+ }
24+
2025function DeviceManagementPage ( ) {
2126 const styles = useThemeStyles ( ) ;
2227 const { translate, datetimeToRelative} = useLocalize ( ) ;
2328
2429 const [ logins ] = useOnyx ( ONYXKEYS . LOGINS , { selector : getDeviceLogins } ) ;
30+ const [ autoGeneratedLogin ] = useOnyx ( ONYXKEYS . CREDENTIALS , { selector : autoGeneratedLoginSelector } ) ;
2531
2632 const renderItem = ( { item} : ListRenderItemInfo < Login > ) => {
2733 const { deviceName, deviceVersion, os, osVersion} = item . additionalData ?? { } ;
@@ -40,7 +46,7 @@ function DeviceManagementPage() {
4046 danger
4147 small
4248 text = { translate ( 'deviceManagementPage.revoke' ) }
43- onPress = { ( ) => revokeDevice ( item ) }
49+ onPress = { ( ) => revokeDevice ( item , autoGeneratedLogin ) }
4450 />
4551 </ OfflineWithFeedback >
4652 ) ;
@@ -55,9 +61,7 @@ function DeviceManagementPage() {
5561 title = { translate ( 'deviceManagementPage.title' ) }
5662 onBackButtonPress = { Navigation . goBack }
5763 />
58- < View style = { [ styles . ph5 , styles . pv3 ] } >
59- < RenderHTML html = { translate ( 'deviceManagementPage.description' ) } />
60- </ View >
64+ < Text style = { [ styles . ph5 , styles . pv3 ] } > { translate ( 'deviceManagementPage.description' ) } </ Text >
6165 < FlashList
6266 data = { logins }
6367 renderItem = { renderItem }
0 commit comments