@@ -10,11 +10,18 @@ import { findDuressStash, LoginStash } from './login-stash'
1010import { WalletInfoFullMap } from './login-types'
1111import { findPin2Stash } from './pin2'
1212
13+ export interface DeviceInfo {
14+ readonly deviceDescription ?: string
15+ readonly osType ?: string
16+ readonly osVersion ?: string
17+ readonly appVersion ?: string
18+ }
19+
1320export interface LoginState {
1421 readonly apiKey : string
1522 readonly apiSecret : Uint8Array | null
1623 readonly contextAppId : string
17- readonly deviceDescription : string | null
24+ readonly deviceInfo : DeviceInfo
1825 readonly loginServers : string [ ]
1926 readonly stashes : LoginStash [ ]
2027 readonly localUsers : EdgeUserInfo [ ]
@@ -34,8 +41,18 @@ export const login = buildReducer<LoginState, RootAction, RootState>({
3441 return action . type === 'INIT' ? action . payload . appId : state
3542 } ,
3643
37- deviceDescription ( state = null , action ) : string | null {
38- return action . type === 'INIT' ? action . payload . deviceDescription : state
44+ deviceInfo ( state : DeviceInfo = { } , action ) : DeviceInfo {
45+ if ( action . type === 'INIT' ) {
46+ const { appVersion, deviceDescription, osType, osVersion } =
47+ action . payload
48+ return {
49+ deviceDescription : deviceDescription ?? undefined ,
50+ osType,
51+ osVersion,
52+ appVersion
53+ }
54+ }
55+ return state
3956 } ,
4057
4158 localUsers : memoizeReducer (
0 commit comments