Skip to content

Commit

Permalink
update profile logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Feb 29, 2024
1 parent 4dd4245 commit 9c5ac10
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/app/shared/enum/type/profile/did_key_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ extension DidKeyTypeX on DidKeyType {
switch (this) {
case DidKeyType.secp256k1:
case DidKeyType.p256:
case DidKeyType.jwkP256:
return true;
case DidKeyType.edDSA:
case DidKeyType.ebsiv3:
case DidKeyType.jwkP256:
return false;
}
}
Expand Down
12 changes: 11 additions & 1 deletion lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1346,15 +1346,25 @@ bool supportCryptoCredential(ProfileSetting profileSetting) {
final customOidc4vcProfile =
profileSetting.selfSovereignIdentityOptions.customOidc4vcProfile;

/// suported VC format
final supportCryptoCredentialByVCFormat =
customOidc4vcProfile.vcFormatType.supportCryptoCredential;

/// supported did key
final supportCryptoCredentialByDidKey =
customOidc4vcProfile.defaultDid.supportCryptoCredential;

final supportAssociatedCredential =
/// match format 1
final matchFormat1 =
supportCryptoCredentialByVCFormat && supportCryptoCredentialByDidKey;

/// match format 2
final matchFormat2 = customOidc4vcProfile.defaultDid == DidKeyType.edDSA &&
customOidc4vcProfile.vcFormatType == VCFormatType.ldpVc &&
!customOidc4vcProfile.cryptoHolderBinding;

final supportAssociatedCredential = matchFormat1 || matchFormat2;

return supportAssociatedCredential;
}

Expand Down
1 change: 1 addition & 0 deletions lib/dashboard/drawer/src/view/drawer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DrawerView extends StatelessWidget {
title: l10n.updateYourWalletConfigNow,
padding: const EdgeInsets.all(16),
onClick: () async {
Navigator.of(context).pop();
await context
.read<EnterpriseCubit>()
.updateTheConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class HomeCredentialCategoryList extends StatelessWidget {
return true;
}

/// crypto credential account to be shown always
if (element.credentialPreview.credentialSubjectModel
.credentialSubjectType.isBlockchainAccount) {
return true;
}

/// do not load the credential if vc format is different
if (vcFormatType.value != element.getFormat) {
return false;
Expand Down

0 comments on commit 9c5ac10

Please sign in to comment.