fix(keycard): unable to pass pin entry screen in certain flows

Fixes: #13289
This commit is contained in:
Sale Djenic 2024-01-29 12:35:05 +01:00 committed by saledjenic
parent bbaafa8954
commit 2ae217a830
1 changed files with 4 additions and 2 deletions

View File

@ -25,14 +25,14 @@ proc ensureReaderAndCardPresence*(state: State, keycardFlowType: string, keycard
keycardEvent.error == ErrorReaderList): keycardEvent.error == ErrorReaderList):
controller.reRunCurrentFlowLater() controller.reRunCurrentFlowLater()
if state.stateType == StateType.PluginReader: if state.stateType == StateType.PluginReader:
return nil return state
return createState(StateType.PluginReader, state.flowType, nil) return createState(StateType.PluginReader, state.flowType, nil)
if keycardFlowType == ResponseTypeValueInsertCard and if keycardFlowType == ResponseTypeValueInsertCard and
keycardEvent.error.len > 0 and keycardEvent.error.len > 0 and
keycardEvent.error == ErrorConnection: keycardEvent.error == ErrorConnection:
controller.reRunCurrentFlowLater() controller.reRunCurrentFlowLater()
if state.stateType == StateType.InsertKeycard: if state.stateType == StateType.InsertKeycard:
return nil return state
return createState(StateType.InsertKeycard, state.flowType, nil) return createState(StateType.InsertKeycard, state.flowType, nil)
if keycardFlowType == ResponseTypeValueCardInserted: if keycardFlowType == ResponseTypeValueCardInserted:
controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.WronglyInsertedCard, add = false)) controller.setKeycardData(updatePredefinedKeycardData(controller.getKeycardData(), PredefinedKeycardData.WronglyInsertedCard, add = false))
@ -645,6 +645,8 @@ proc readingKeycard*(state: State, keycardFlowType: string, keycardEvent: Keycar
if keyUid != keycardEvent.keyUid: if keyUid != keycardEvent.keyUid:
return createState(StateType.WrongKeycard, state.flowType, nil) return createState(StateType.WrongKeycard, state.flowType, nil)
controller.setKeycardUid(keycardEvent.instanceUID) controller.setKeycardUid(keycardEvent.instanceUID)
return nextState
return ensureKeycardPresenceState
# this is used in case a keycard is inserted and we jump to the first meaningful screen # this is used in case a keycard is inserted and we jump to the first meaningful screen
return ensureReaderAndCardPresenceAndResolveNextState(state, keycardFlowType, keycardEvent, controller) return ensureReaderAndCardPresenceAndResolveNextState(state, keycardFlowType, keycardEvent, controller)