Skip to content

Commit

Permalink
Profile DIIP add issuer for phone proof in discover #2440
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Feb 29, 2024
1 parent cf36bfe commit 78c24a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,6 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {
case CredentialSubjectType.ageRange:
case CredentialSubjectType.defiCompliance:
case CredentialSubjectType.tezotopiaMembership:
case CredentialSubjectType.phonePass:
case CredentialSubjectType.chainbornMembership:
return [VCFormatType.ldpVc];

Expand All @@ -654,15 +653,14 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {
];

case CredentialSubjectType.over18:
case CredentialSubjectType.phonePass:
case CredentialSubjectType.livenessCard:
case CredentialSubjectType.emailPass:
return [
VCFormatType.ldpVc,
VCFormatType.jwtVcJson,
];

case CredentialSubjectType.livenessCard:
case CredentialSubjectType.emailPass:
return [VCFormatType.ldpVc, VCFormatType.jwtVcJson];

case CredentialSubjectType.nationality:
case CredentialSubjectType.identityPass:
case CredentialSubjectType.passportFootprint:
Expand Down
17 changes: 11 additions & 6 deletions lib/credentials/cubit/credentials_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,17 @@ class CredentialsCubit extends Cubit<CredentialsState> {
}
}

if (discoverCardsOptions.displayPhonePass &&
!allSubjectTypeForCategory
.contains(CredentialSubjectType.phonePass)) {
allSubjectTypeForCategory.add(
CredentialSubjectType.phonePass,
);
if (!allSubjectTypeForCategory
.contains(CredentialSubjectType.phonePass)) {
final displayPhonePass = vcFormatType == VCFormatType.ldpVc &&
discoverCardsOptions.displayPhonePass;
final displayPhonePassJwt =
vcFormatType == VCFormatType.jwtVcJson &&
discoverCardsOptions.displayPhonePassJwt;

if (displayPhonePass || displayPhonePassJwt) {
allSubjectTypeForCategory.add(CredentialSubjectType.phonePass);
}
}

case CredentialCategory.educationCards:
Expand Down
2 changes: 1 addition & 1 deletion lib/dashboard/profile/models/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ProfileModel extends Equatable {
displayEmailPass: true,
displayEmailPassJwt: true,
displayPhonePass: false,
displayPhonePassJwt: false,
displayPhonePassJwt: true,
displayAgeRange: false,
displayGender: false,
displayExternalIssuer: [],
Expand Down

0 comments on commit 78c24a8

Please sign in to comment.