mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
fix(@desktop/onboarding): back button actions fixed part 1/2
This commit is contained in:
parent
3ca03bdd49
commit
2146843e93
@ -178,6 +178,9 @@ proc getImportedAccount*(self: Controller): GeneratedAccountDto =
|
|||||||
proc getPasswordStrengthScore*(self: Controller, password, userName: string): int =
|
proc getPasswordStrengthScore*(self: Controller, password, userName: string): int =
|
||||||
return self.generalService.getPasswordStrengthScore(password, userName)
|
return self.generalService.getPasswordStrengthScore(password, userName)
|
||||||
|
|
||||||
|
proc clearImage*(self: Controller) =
|
||||||
|
self.tmpProfileImageDetails = ProfileImageDetails()
|
||||||
|
|
||||||
proc generateImage*(self: Controller, imageUrl: string, aX: int, aY: int, bX: int, bY: int): string =
|
proc generateImage*(self: Controller, imageUrl: string, aX: int, aY: int, bX: int, bY: int): string =
|
||||||
let formatedImg = singletonInstance.utils.formatImagePath(imageUrl)
|
let formatedImg = singletonInstance.utils.formatImagePath(imageUrl)
|
||||||
let images = self.generalService.generateImages(formatedImg, aX, aY, bX, bY)
|
let images = self.generalService.generateImages(formatedImg, aX, aY, bX, bY)
|
||||||
|
@ -13,10 +13,6 @@ proc delete*(self: KeycardCreatePinState) =
|
|||||||
method executeBackCommand*(self: KeycardCreatePinState, controller: Controller) =
|
method executeBackCommand*(self: KeycardCreatePinState, controller: Controller) =
|
||||||
controller.setPin("")
|
controller.setPin("")
|
||||||
controller.setPinMatch(false)
|
controller.setPinMatch(false)
|
||||||
if self.flowType == FlowType.FirstRunNewUserNewKeycardKeys or
|
|
||||||
self.flowType == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard or
|
|
||||||
self.flowType == FlowType.FirstRunOldUserKeycardImport:
|
|
||||||
controller.cancelCurrentFlow()
|
|
||||||
|
|
||||||
method getNextPrimaryState*(self: KeycardCreatePinState, controller: Controller): State =
|
method getNextPrimaryState*(self: KeycardCreatePinState, controller: Controller): State =
|
||||||
if not self.pinValid:
|
if not self.pinValid:
|
||||||
|
@ -40,6 +40,19 @@ method resolveKeycardNextState*(self: KeycardEnterPinState, keycardFlowType: str
|
|||||||
if keycardEvent.pinRetries > 0:
|
if keycardEvent.pinRetries > 0:
|
||||||
return createState(StateType.KeycardWrongPin, self.flowType, self.getBackState)
|
return createState(StateType.KeycardWrongPin, self.flowType, self.getBackState)
|
||||||
return createState(StateType.KeycardMaxPinRetriesReached, self.flowType, self.getBackState)
|
return createState(StateType.KeycardMaxPinRetriesReached, self.flowType, self.getBackState)
|
||||||
|
if keycardFlowType == ResponseTypeValueEnterPUK and
|
||||||
|
keycardEvent.error.len == 0:
|
||||||
|
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
||||||
|
return createState(StateType.KeycardMaxPinRetriesReached, self.flowType, self.getBackState)
|
||||||
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
|
keycardEvent.error.len > 0 and
|
||||||
|
keycardEvent.error == RequestParamPUKRetries:
|
||||||
|
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = true))
|
||||||
|
return createState(StateType.KeycardMaxPukRetriesReached, self.flowType, self.getBackState)
|
||||||
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
|
keycardEvent.error.len > 0 and
|
||||||
|
keycardEvent.error == RequestParamFreeSlots:
|
||||||
|
return createState(StateType.KeycardMaxPairingSlotsReached, self.flowType, self.getBackState)
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
||||||
controller.setKeycardEvent(keycardEvent)
|
controller.setKeycardEvent(keycardEvent)
|
||||||
if not defined(macosx):
|
if not defined(macosx):
|
||||||
|
@ -24,4 +24,5 @@ method resolveKeycardNextState*(self: KeycardEnterSeedPhraseWordsState, keycardF
|
|||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
||||||
keycardEvent.keyUid.len > 0:
|
keycardEvent.keyUid.len > 0:
|
||||||
controller.setKeyUid(keycardEvent.keyUid)
|
controller.setKeyUid(keycardEvent.keyUid)
|
||||||
return createState(StateType.UserProfileCreate, self.flowType, self)
|
let backState = findBackStateWithTargetedStateType(self, StateType.WelcomeNewStatusUser)
|
||||||
|
return createState(StateType.UserProfileCreate, self.flowType, backState)
|
@ -40,16 +40,17 @@ method resolveKeycardNextState*(self: KeycardRepeatPinState, keycardFlowType: st
|
|||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
||||||
keycardEvent.keyUid.len > 0:
|
keycardEvent.keyUid.len > 0:
|
||||||
controller.setKeyUid(keycardEvent.keyUid)
|
controller.setKeyUid(keycardEvent.keyUid)
|
||||||
return createState(StateType.KeycardPinSet, self.flowType, self.getBackState)
|
let backState = findBackStateWithTargetedStateType(self, StateType.UserProfileImportSeedPhrase)
|
||||||
|
return createState(StateType.KeycardPinSet, self.flowType, backState)
|
||||||
if self.flowType == FlowType.FirstRunOldUserKeycardImport:
|
if self.flowType == FlowType.FirstRunOldUserKeycardImport:
|
||||||
if keycardFlowType == ResponseTypeValueEnterPUK and
|
if keycardFlowType == ResponseTypeValueEnterPUK:
|
||||||
keycardEvent.error.len > 0 and
|
if keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == RequestParamPUK:
|
keycardEvent.error == RequestParamPUK:
|
||||||
controller.setRemainingAttempts(keycardEvent.pukRetries)
|
controller.setRemainingAttempts(keycardEvent.pukRetries)
|
||||||
controller.setPukValid(false)
|
controller.setPukValid(false)
|
||||||
if keycardEvent.pukRetries > 0:
|
if keycardEvent.pukRetries > 0:
|
||||||
return createState(StateType.KeycardPinSet, self.flowType, self.getBackState)
|
return createState(StateType.KeycardPinSet, self.flowType, self.getBackState)
|
||||||
return createState(StateType.KeycardMaxPukRetriesReached, self.flowType, self.getBackState)
|
return createState(StateType.KeycardMaxPukRetriesReached, self.flowType, self.getBackState)
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
||||||
controller.setKeycardEvent(keycardEvent)
|
controller.setKeycardEvent(keycardEvent)
|
||||||
controller.setPukValid(true)
|
controller.setPukValid(true)
|
||||||
|
@ -36,6 +36,15 @@ method resolveKeycardNextState*(self: KeycardWrongPinState, keycardFlowType: str
|
|||||||
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
||||||
return createState(StateType.KeycardMaxPinRetriesReached, self.flowType, self.getBackState)
|
return createState(StateType.KeycardMaxPinRetriesReached, self.flowType, self.getBackState)
|
||||||
return nil
|
return nil
|
||||||
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
|
keycardEvent.error.len > 0 and
|
||||||
|
keycardEvent.error == RequestParamPUKRetries:
|
||||||
|
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = true))
|
||||||
|
return createState(StateType.KeycardMaxPukRetriesReached, self.flowType, self.getBackState)
|
||||||
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
|
keycardEvent.error.len > 0 and
|
||||||
|
keycardEvent.error == RequestParamFreeSlots:
|
||||||
|
return createState(StateType.KeycardMaxPairingSlotsReached, self.flowType, self.getBackState)
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult:
|
||||||
controller.setKeycardEvent(keycardEvent)
|
controller.setKeycardEvent(keycardEvent)
|
||||||
if not defined(macosx):
|
if not defined(macosx):
|
||||||
|
@ -1,11 +1,18 @@
|
|||||||
proc ensureReaderAndCardPresenceOnboarding*(state: State, keycardFlowType: string, keycardEvent: KeycardEvent, controller: Controller): State =
|
proc ensureReaderAndCardPresenceOnboarding*(state: State, keycardFlowType: string, keycardEvent: KeycardEvent, controller: Controller): State =
|
||||||
|
var defaultBackState = state
|
||||||
|
if state.flowType == FlowType.FirstRunNewUserNewKeycardKeys and
|
||||||
|
state.stateType == StateType.KeycardEmpty:
|
||||||
|
## `KeycardEmpty` state is known in the context of `FirstRunNewUserNewKeycardKeys` only if we jump to it from
|
||||||
|
## `FirstRunOldUserKeycardImport` flow, in that case we need to set back state appropriatelly respecting different flow.
|
||||||
|
defaultBackState = state.getBackState
|
||||||
|
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorConnection:
|
keycardEvent.error == ErrorConnection:
|
||||||
controller.resumeCurrentFlowLater()
|
controller.resumeCurrentFlowLater()
|
||||||
if state.stateType == StateType.KeycardPluginReader:
|
if state.stateType == StateType.KeycardPluginReader:
|
||||||
return nil
|
return nil
|
||||||
return createState(StateType.KeycardPluginReader, state.flowType, state)
|
return createState(StateType.KeycardPluginReader, state.flowType, defaultBackState)
|
||||||
if keycardFlowType == ResponseTypeValueInsertCard and
|
if keycardFlowType == ResponseTypeValueInsertCard and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorConnection:
|
keycardEvent.error == ErrorConnection:
|
||||||
@ -13,12 +20,12 @@ proc ensureReaderAndCardPresenceOnboarding*(state: State, keycardFlowType: strin
|
|||||||
return nil
|
return nil
|
||||||
if state.stateType == StateType.KeycardPluginReader:
|
if state.stateType == StateType.KeycardPluginReader:
|
||||||
return createState(StateType.KeycardInsertKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardInsertKeycard, state.flowType, state.getBackState)
|
||||||
return createState(StateType.KeycardInsertKeycard, state.flowType, state)
|
return createState(StateType.KeycardInsertKeycard, state.flowType, defaultBackState)
|
||||||
if keycardFlowType == ResponseTypeValueCardInserted:
|
if keycardFlowType == ResponseTypeValueCardInserted:
|
||||||
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.WronglyInsertedCard, add = false))
|
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.WronglyInsertedCard, add = false))
|
||||||
if state.stateType == StateType.KeycardInsertKeycard:
|
if state.stateType == StateType.KeycardInsertKeycard:
|
||||||
return createState(StateType.KeycardInsertedKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardInsertedKeycard, state.flowType, state.getBackState)
|
||||||
return createState(StateType.KeycardInsertedKeycard, state.flowType, state)
|
return createState(StateType.KeycardInsertedKeycard, state.flowType, defaultBackState)
|
||||||
|
|
||||||
proc ensureReaderAndCardPresenceAndResolveNextOnboardingState*(state: State, keycardFlowType: string, keycardEvent: KeycardEvent, controller: Controller): State =
|
proc ensureReaderAndCardPresenceAndResolveNextOnboardingState*(state: State, keycardFlowType: string, keycardEvent: KeycardEvent, controller: Controller): State =
|
||||||
let ensureState = ensureReaderAndCardPresenceOnboarding(state, keycardFlowType, keycardEvent, controller)
|
let ensureState = ensureReaderAndCardPresenceOnboarding(state, keycardFlowType, keycardEvent, controller)
|
||||||
@ -26,89 +33,98 @@ proc ensureReaderAndCardPresenceAndResolveNextOnboardingState*(state: State, key
|
|||||||
return ensureState
|
return ensureState
|
||||||
|
|
||||||
if state.flowType == FlowType.FirstRunNewUserNewKeycardKeys:
|
if state.flowType == FlowType.FirstRunNewUserNewKeycardKeys:
|
||||||
|
var backState = state.getBackState
|
||||||
|
if state.stateType == StateType.WelcomeNewStatusUser:
|
||||||
|
backState = state
|
||||||
|
|
||||||
|
if state.stateType == StateType.KeycardEmpty:
|
||||||
|
## `KeycardEmpty` state is known in the context of `FirstRunNewUserNewKeycardKeys` only if we jump to it from
|
||||||
|
## `FirstRunOldUserKeycardImport` flow, in that case we need to set back state appropriatelly respecting different flow.
|
||||||
|
backState = state.getBackState
|
||||||
|
|
||||||
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorRequireInit:
|
keycardEvent.error == ErrorRequireInit:
|
||||||
return createState(StateType.KeycardRecognizedKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardRecognizedKeycard, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterPIN and
|
if keycardFlowType == ResponseTypeValueEnterPIN and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
return createState(StateType.KeycardNotEmpty, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotEmpty, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterPUK and
|
if keycardFlowType == ResponseTypeValueEnterPUK and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
||||||
return createState(StateType.KeycardLocked, state.flowType, state.getBackState)
|
return createState(StateType.KeycardLocked, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
keycardEvent.error.len > 0:
|
keycardEvent.error.len > 0:
|
||||||
if keycardEvent.error == ErrorNotAKeycard:
|
if keycardEvent.error == ErrorNotAKeycard:
|
||||||
return createState(StateType.KeycardNotKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotKeycard, state.flowType, backState)
|
||||||
if keycardEvent.error == RequestParamFreeSlots:
|
if keycardEvent.error == RequestParamFreeSlots:
|
||||||
return createState(StateType.KeycardLocked, state.flowType, state.getBackState)
|
return createState(StateType.KeycardLocked, state.flowType, backState)
|
||||||
if keycardEvent.error == RequestParamPUKRetries:
|
if keycardEvent.error == RequestParamPUKRetries:
|
||||||
return createState(StateType.KeycardLocked, state.flowType, state.getBackState)
|
return createState(StateType.KeycardLocked, state.flowType, backState)
|
||||||
if keycardEvent.error == ErrorHasKeys:
|
if keycardEvent.error == ErrorHasKeys:
|
||||||
return createState(StateType.KeycardNotEmpty, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotEmpty, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterMnemonic and
|
if keycardFlowType == ResponseTypeValueEnterMnemonic and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorLoadingKeys:
|
keycardEvent.error == ErrorLoadingKeys:
|
||||||
controller.buildSeedPhrasesFromIndexes(keycardEvent.seedPhraseIndexes)
|
controller.buildSeedPhrasesFromIndexes(keycardEvent.seedPhraseIndexes)
|
||||||
return createState(StateType.KeycardPinSet, state.flowType, state.getBackState)
|
return createState(StateType.KeycardPinSet, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
|
||||||
keycardEvent.keyUid.len > 0:
|
|
||||||
controller.setKeyUid(keycardEvent.keyUid)
|
|
||||||
return createState(StateType.UserProfileCreate, state.flowType, state)
|
|
||||||
|
|
||||||
if state.flowType == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard:
|
if state.flowType == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard:
|
||||||
|
var backState = state.getBackState
|
||||||
|
if state.stateType == StateType.UserProfileImportSeedPhrase:
|
||||||
|
backState = state
|
||||||
|
|
||||||
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorRequireInit:
|
keycardEvent.error == ErrorRequireInit:
|
||||||
if state.stateType == StateType.UserProfileEnterSeedPhrase:
|
if state.stateType == StateType.UserProfileEnterSeedPhrase:
|
||||||
return createState(StateType.KeycardCreatePin, state.flowType, state.getBackState)
|
return createState(StateType.KeycardCreatePin, state.flowType, backState)
|
||||||
return createState(StateType.KeycardRecognizedKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardRecognizedKeycard, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterPIN and
|
if keycardFlowType == ResponseTypeValueEnterPIN and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
return createState(StateType.KeycardNotEmpty, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotEmpty, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
keycardEvent.error.len > 0:
|
keycardEvent.error.len > 0:
|
||||||
if keycardEvent.error == ErrorNotAKeycard:
|
if keycardEvent.error == ErrorNotAKeycard:
|
||||||
return createState(StateType.KeycardNotKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotKeycard, state.flowType, backState)
|
||||||
if keycardEvent.error == RequestParamFreeSlots:
|
if keycardEvent.error == RequestParamFreeSlots:
|
||||||
return createState(StateType.KeycardLocked, state.flowType, state.getBackState)
|
return createState(StateType.KeycardLocked, state.flowType, backState)
|
||||||
if keycardEvent.error == RequestParamPUKRetries:
|
if keycardEvent.error == RequestParamPUKRetries:
|
||||||
return createState(StateType.KeycardLocked, state.flowType, state.getBackState)
|
return createState(StateType.KeycardLocked, state.flowType, backState)
|
||||||
if keycardEvent.error == ErrorHasKeys:
|
if keycardEvent.error == ErrorHasKeys:
|
||||||
return createState(StateType.KeycardNotEmpty, state.flowType, state.getBackState)
|
return createState(StateType.KeycardNotEmpty, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
|
||||||
keycardEvent.keyUid.len > 0:
|
|
||||||
controller.setKeyUid(keycardEvent.keyUid)
|
|
||||||
return createState(StateType.KeycardPinSet, state.flowType, state.getBackState)
|
|
||||||
|
|
||||||
if state.flowType == FlowType.FirstRunOldUserKeycardImport:
|
if state.flowType == FlowType.FirstRunOldUserKeycardImport:
|
||||||
|
var backState = state.getBackState
|
||||||
|
if state.stateType == StateType.RecoverOldUser:
|
||||||
|
backState = state
|
||||||
|
|
||||||
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = false))
|
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = false))
|
||||||
controller.setKeyUid(keycardEvent.keyUid)
|
controller.setKeyUid(keycardEvent.keyUid)
|
||||||
if keycardFlowType == ResponseTypeValueEnterPIN and
|
if keycardFlowType == ResponseTypeValueEnterPIN and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
return createState(StateType.KeycardRecognizedKeycard, state.flowType, state.getBackState)
|
return createState(StateType.KeycardRecognizedKeycard, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterPUK and
|
if keycardFlowType == ResponseTypeValueEnterPUK and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
if keycardEvent.pinRetries == 0 and keycardEvent.pukRetries > 0:
|
||||||
return createState(StateType.KeycardMaxPinRetriesReached, state.flowType, state.getBackState)
|
return createState(StateType.KeycardMaxPinRetriesReached, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorNoKeys:
|
keycardEvent.error == ErrorNoKeys:
|
||||||
return createState(StateType.KeycardEmpty, state.flowType, nil)
|
return createState(StateType.KeycardEmpty, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == RequestParamPUKRetries:
|
keycardEvent.error == RequestParamPUKRetries:
|
||||||
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = true))
|
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.MaxPUKReached, add = true))
|
||||||
return createState(StateType.KeycardMaxPukRetriesReached, state.flowType, state.getBackState)
|
return createState(StateType.KeycardMaxPukRetriesReached, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == RequestParamFreeSlots:
|
keycardEvent.error == RequestParamFreeSlots:
|
||||||
return createState(StateType.KeycardMaxPairingSlotsReached, state.flowType, state.getBackState)
|
return createState(StateType.KeycardMaxPairingSlotsReached, state.flowType, backState)
|
||||||
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
if keycardFlowType == ResponseTypeValueEnterNewPIN and
|
||||||
keycardEvent.error.len > 0 and
|
keycardEvent.error.len > 0 and
|
||||||
keycardEvent.error == ErrorRequireInit:
|
keycardEvent.error == ErrorRequireInit:
|
||||||
return createState(StateType.KeycardCreatePin, state.flowType, nil)
|
return createState(StateType.KeycardCreatePin, state.flowType, backState)
|
||||||
|
|
||||||
if state.flowType == FlowType.AppLogin:
|
if state.flowType == FlowType.AppLogin:
|
||||||
if keycardFlowType == ResponseTypeValueSwapCard and
|
if keycardFlowType == ResponseTypeValueSwapCard and
|
||||||
|
@ -20,4 +20,5 @@ method getNextPrimaryState*(self: UserProfileCreateState, controller: Controller
|
|||||||
return createState(StateType.UserProfileChatKey, self.flowType, self)
|
return createState(StateType.UserProfileChatKey, self.flowType, self)
|
||||||
|
|
||||||
method executeBackCommand*(self: UserProfileCreateState, controller: Controller) =
|
method executeBackCommand*(self: UserProfileCreateState, controller: Controller) =
|
||||||
controller.setDisplayName("")
|
controller.setDisplayName("")
|
||||||
|
controller.clearImage()
|
@ -23,7 +23,7 @@ method getNextPrimaryState*(self: UserProfileEnterSeedPhraseState, controller: C
|
|||||||
return createState(StateType.UserProfileCreate, self.flowType, self)
|
return createState(StateType.UserProfileCreate, self.flowType, self)
|
||||||
if self.flowType == FlowType.FirstRunOldUserKeycardImport:
|
if self.flowType == FlowType.FirstRunOldUserKeycardImport:
|
||||||
if not self.enteredMnemonicMatchTargetedKeyUid:
|
if not self.enteredMnemonicMatchTargetedKeyUid:
|
||||||
return createState(StateType.KeycardWrongKeycard, self.flowType, nil)
|
return createState(StateType.KeycardWrongKeycard, self.flowType, self)
|
||||||
if self.flowType == FlowType.FirstRunOldUserImportSeedPhrase:
|
if self.flowType == FlowType.FirstRunOldUserImportSeedPhrase:
|
||||||
return createState(StateType.UserProfileCreatePassword, self.flowType, self)
|
return createState(StateType.UserProfileCreatePassword, self.flowType, self)
|
||||||
|
|
||||||
|
@ -458,13 +458,15 @@ method onSharedKeycarModuleFlowTerminated*[T](self: Module[T], lastStepInTheCurr
|
|||||||
if currStateObj.isNil:
|
if currStateObj.isNil:
|
||||||
error "cannot resolve current state for onboarding/login flow continuation"
|
error "cannot resolve current state for onboarding/login flow continuation"
|
||||||
return
|
return
|
||||||
if currStateObj.flowType() == FlowType.LostKeycardReplacement:
|
if currStateObj.flowType() == FlowType.FirstRunNewUserNewKeycardKeys or
|
||||||
let newState = currStateObj.getBackState()
|
currStateObj.flowType() == FlowType.FirstRunNewUserImportSeedPhraseIntoKeycard or
|
||||||
if newState.isNil:
|
currStateObj.flowType() == FlowType.LostKeycardReplacement:
|
||||||
error "cannot resolve new state for onboarding/login flow continuation after shared flow is terminated"
|
let newState = currStateObj.getBackState()
|
||||||
return
|
if newState.isNil:
|
||||||
self.view.setCurrentStartupState(newState)
|
error "cannot resolve new state for onboarding/login flow continuation after shared flow is terminated"
|
||||||
debug "new state for onboarding/login flow continuation after shared flow is terminated", setCurrFlow=newState.flowType(), newCurrState=newState.stateType()
|
return
|
||||||
|
self.view.setCurrentStartupState(newState)
|
||||||
|
debug "new state for onboarding/login flow continuation after shared flow is terminated", setCurrFlow=newState.flowType(), newCurrState=newState.stateType()
|
||||||
|
|
||||||
method storeKeyPairForNewKeycardUser*[T](self: Module[T]) =
|
method storeKeyPairForNewKeycardUser*[T](self: Module[T]) =
|
||||||
self.delegate.storeKeyPairForNewKeycardUser()
|
self.delegate.storeKeyPairForNewKeycardUser()
|
||||||
|
@ -403,7 +403,7 @@ Item {
|
|||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: txtDesc
|
target: txtDesc
|
||||||
text: qsTr("Seed phrases are used to back up and restore your keys. Only use this option if you already have a seed phrase.")
|
text: qsTr("Seed phrases are used to back up and restore your keys.\nOnly use this option if you already have a seed phrase.")
|
||||||
height: Constants.onboarding.loginInfoHeight2
|
height: Constants.onboarding.loginInfoHeight2
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user