fix(keycard): unable to re-run keycard flow on windows

The issue re-running keycard flows on Windows is fixed in this commit,
cause a different signal was emitted on windows in case of missing Keycard.
This commit is contained in:
Sale Djenic 2024-01-22 10:29:11 +01:00 committed by saledjenic
parent 7e3ae8dd7a
commit bd3e9cb67c
3 changed files with 17 additions and 13 deletions

View File

@ -21,7 +21,8 @@ proc ensureReaderAndCardPresence*(state: State, keycardFlowType: string, keycard
state.flowType == FlowType.MigrateFromAppToKeycard:
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
keycardEvent.error.len > 0 and
keycardEvent.error == ErrorNoReader:
(keycardEvent.error == ErrorNoReader or
keycardEvent.error == ErrorReaderList):
controller.reRunCurrentFlowLater()
if state.stateType == StateType.PluginReader:
return nil
@ -41,8 +42,9 @@ proc ensureReaderAndCardPresence*(state: State, keycardFlowType: string, keycard
if state.flowType == FlowType.SetupNewKeycard:
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
keycardEvent.error.len > 0 and
keycardEvent.error == ErrorConnection or
keycardEvent.error == ErrorNoReader:
(keycardEvent.error == ErrorConnection or
keycardEvent.error == ErrorNoReader or
keycardEvent.error == ErrorReaderList):
controller.reRunCurrentFlowLater()
if state.stateType == StateType.PluginReader:
return nil

View File

@ -3,11 +3,12 @@ proc ensureReaderAndCardPresenceLogin*(state: State, keycardFlowType: string, ke
keycardEvent.error.len > 0:
if keycardEvent.error == ErrorPCSC:
return createState(StateType.LoginNoPCSCService, state.flowType, nil)
if keycardEvent.error == ErrorNoReader:
controller.reRunCurrentFlowLater()
if state.stateType == StateType.LoginPlugin:
return nil
return createState(StateType.LoginPlugin, state.flowType, nil)
if keycardEvent.error == ErrorNoReader or
keycardEvent.error == ErrorReaderList:
controller.reRunCurrentFlowLater()
if state.stateType == StateType.LoginPlugin:
return nil
return createState(StateType.LoginPlugin, state.flowType, nil)
if keycardFlowType == ResponseTypeValueInsertCard and
keycardEvent.error.len > 0 and
keycardEvent.error == ErrorConnection:

View File

@ -4,11 +4,12 @@ proc ensureReaderAndCardPresenceOnboarding*(state: State, keycardFlowType: strin
keycardEvent.error.len > 0:
if keycardEvent.error == ErrorPCSC:
return createState(StateType.KeycardNoPCSCService, state.flowType, backState)
if keycardEvent.error == ErrorNoReader:
controller.reRunCurrentFlowLater()
if state.stateType == StateType.KeycardPluginReader:
return nil
return createState(StateType.KeycardPluginReader, state.flowType, backState)
if keycardEvent.error == ErrorNoReader or
keycardEvent.error == ErrorReaderList:
controller.reRunCurrentFlowLater()
if state.stateType == StateType.KeycardPluginReader:
return nil
return createState(StateType.KeycardPluginReader, state.flowType, backState)
if keycardFlowType == ResponseTypeValueInsertCard and
keycardEvent.error.len > 0 and
keycardEvent.error == ErrorConnection: