fix(@desktop/keycard): biometric screen on linux

This fix skips biometric screen for the following flow on other than mac os platforms:
`first run - new user - import a seed phrase into a new Keycard`
This commit is contained in:
Sale Djenic 2022-08-23 17:05:02 +02:00 committed by saledjenic
parent 8eb328bae7
commit 1c77192d5b
1 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,17 @@ proc newUserProfileChatKeyState*(flowType: FlowType, backState: State): UserProf
proc delete*(self: UserProfileChatKeyState) =
self.State.delete
method executePrimaryCommand*(self: UserProfileChatKeyState, controller: Controller) =
if defined(macosx):
return
let storeToKeychain = false # false, cause we don't have keychain support for other than mac os
if self.flowType == FlowType.FirstRunNewUserNewKeycardKeys:
controller.storeKeycardAccountAndLogin(storeToKeychain)
elif self.flowType == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard:
controller.storeKeycardAccountAndLogin(storeToKeychain)
elif self.flowType == FlowType.FirstRunOldUserKeycardImport:
controller.setupKeycardAccount(storeToKeychain)
method getNextPrimaryState*(self: UserProfileChatKeyState, controller: Controller): State =
if self.flowType == FlowType.FirstRunNewUserNewKeys or
self.flowType == FlowType.FirstRunNewUserImportSeedPhrase or
@ -16,4 +27,6 @@ method getNextPrimaryState*(self: UserProfileChatKeyState, controller: Controlle
if self.flowType == FlowType.FirstRunNewUserNewKeycardKeys or
self.flowType == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard or
self.flowType == FlowType.FirstRunOldUserKeycardImport:
if not defined(macosx):
return nil
return createState(StateType.Biometrics, self.flowType, self)