From 48e92bb4e27d4bd1366092f7ea627462f24776c6 Mon Sep 17 00:00:00 2001 From: aidenaio Date: Fri, 7 Apr 2023 00:12:33 +0500 Subject: [PATCH] Decide validation result based on identity In a case of API call fails decide on validation result based on known identity chain data --- renderer/screens/validation/report/machines.js | 9 ++++++++- renderer/screens/validation/report/types.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/renderer/screens/validation/report/machines.js b/renderer/screens/validation/report/machines.js index c97d8685f..7f2d5ee3a 100644 --- a/renderer/screens/validation/report/machines.js +++ b/renderer/screens/validation/report/machines.js @@ -135,6 +135,13 @@ export const validationReportMachine = createMachine({ ), ], }, - failed: {}, + failed: { + entry: [ + assign({ + validationResult: ({identity: {isValidated}}) => + isValidated ? ValidationResult.Success : ValidationResult.Fail, + }), + ], + }, }, }) diff --git a/renderer/screens/validation/report/types.js b/renderer/screens/validation/report/types.js index 2bc3bc0d9..349631225 100644 --- a/renderer/screens/validation/report/types.js +++ b/renderer/screens/validation/report/types.js @@ -4,4 +4,5 @@ export const ValidationResult = { LateSubmission: 'late', MissedValidation: 'missed', WrongAnswers: 'wrong', + Fail: 'fail', }