@@ -2,6 +2,7 @@ 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' ;
@@ -14,13 +15,19 @@ import {clearRevokeError, revokeDevice} from '@libs/actions/User';
1415import Navigation from '@libs/Navigation/Navigation' ;
1516import { getDeviceLogins , getLastLogin , getLoginKey } from '@libs/UserUtils' ;
1617import ONYXKEYS from '@src/ONYXKEYS' ;
18+ import type { Credentials } from '@src/types/onyx' ;
1719import type { Login } from '@src/types/onyx/Logins' ;
1820
21+ function autoGeneratedLoginSelector ( credentials : OnyxEntry < Credentials > ) {
22+ return credentials ?. autoGeneratedLogin ;
23+ }
24+
1925function DeviceManagementPage ( ) {
2026 const styles = useThemeStyles ( ) ;
2127 const { translate, datetimeToRelative} = useLocalize ( ) ;
2228
2329 const [ logins ] = useOnyx ( ONYXKEYS . LOGINS , { selector : getDeviceLogins } ) ;
30+ const [ autoGeneratedLogin ] = useOnyx ( ONYXKEYS . CREDENTIALS , { selector : autoGeneratedLoginSelector } ) ;
2431
2532 const renderItem = ( { item} : ListRenderItemInfo < Login > ) => {
2633 const { deviceName, deviceVersion, os, osVersion} = item . additionalData ?? { } ;
@@ -39,7 +46,7 @@ function DeviceManagementPage() {
3946 danger
4047 small
4148 text = { translate ( 'deviceManagementPage.revoke' ) }
42- onPress = { ( ) => revokeDevice ( item ) }
49+ onPress = { ( ) => revokeDevice ( item , autoGeneratedLogin ) }
4350 />
4451 </ OfflineWithFeedback >
4552 ) ;
0 commit comments