From b4a0929c10a7f2065391b24b388fab6f85f64827 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Tue, 29 Aug 2023 09:49:44 +0545 Subject: [PATCH] refactor: Fix credential selection during grouping --- ...dentials_from_presentation_definition.dart | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/get_credentials_from_presentation_definition.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/get_credentials_from_presentation_definition.dart index d1f73012a..65cbbb71c 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/get_credentials_from_presentation_definition.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/helpers/get_credentials_from_presentation_definition.dart @@ -7,25 +7,9 @@ List getCredentialsFromPresentationDefinition({ required int inputDescriptorIndex, required bool? isJwtVpInJwtVCRequired, }) { - final allInputDescriptorConsidered = - presentationDefinition.submissionRequirements != null; - - var filterList = []; - - if (allInputDescriptorConsidered) { - for (final descriptor in presentationDefinition.inputDescriptors) { - if (descriptor.constraints != null && - descriptor.constraints!.fields != null) { - for (final field in descriptor.constraints!.fields!) { - filterList.add(field); - } - } - } - } else { - filterList = presentationDefinition - .inputDescriptors[inputDescriptorIndex].constraints?.fields ?? - []; - } + final filterList = presentationDefinition + .inputDescriptors[inputDescriptorIndex].constraints?.fields ?? + []; /// If we have some instructions we filter the wallet's /// crendential list whith it