Skip to content

Commit

Permalink
Comment out mDL generation button (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
cobward authored Jan 21, 2025
1 parent ba0701c commit fb6396a
Showing 1 changed file with 64 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,70 +178,71 @@ fun WalletSettingsHomeBody(
}
}
// Uncomment to add test mDL generation button to the settings page.
Box(
Modifier
.fillMaxWidth()
.clickable {
scope.launch {
val keyManager = KeyManager()
val keyAlias = "testMdl"
if (!keyManager.keyExists(keyAlias)) {
keyManager.generateSigningKey(keyAlias)
}
val mdl = generateTestMdl(KeyManager(), keyAlias)
val mdocPack =
try {
credentialPacksViewModel.credentialPacks.value.first { pack ->
pack.list().any { credential -> credential.asMsoMdoc() != null }
}
} catch (error: NoSuchElementException) {
CredentialPack()
}
mdocPack.addMdoc(mdl);
credentialPacksViewModel.saveCredentialPack(mdocPack)
}
},
) {
Column {
Row(
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
Row(
verticalAlignment = Alignment.CenterVertically,
) {
Image(
painter = painterResource(id = R.drawable.unknown),
contentDescription = stringResource(id = R.string.unknown_check),
modifier = Modifier.padding(end = 5.dp),
)
Text(
text = "Generate mDL",
fontFamily = Inter,
fontWeight = FontWeight.Medium,
fontSize = 17.sp,
color = ColorStone950,
modifier = Modifier.padding(bottom = 5.dp, top = 5.dp),
)
}
// Box(
// Modifier
// .fillMaxWidth()
// .clickable {
// scope.launch {
// val keyManager = KeyManager()
// val keyAlias = "testMdl"
// if (!keyManager.keyExists(keyAlias)) {
// keyManager.generateSigningKey(keyAlias)
// }
// val mdl = generateTestMdl(KeyManager(), keyAlias)
// val mdocPack =
// try {
// credentialPacksViewModel.credentialPacks.value.first { pack ->
// pack.list().any { credential -> credential.asMsoMdoc() != null }
// }
// } catch (error: NoSuchElementException) {
// CredentialPack()
// }
// mdocPack.addMdoc(mdl);
// credentialPacksViewModel.saveCredentialPack(mdocPack)
// }
// },
// ) {
// Column {
// Row(
// Modifier.fillMaxWidth(),
// horizontalArrangement = Arrangement.SpaceBetween,
// verticalAlignment = Alignment.CenterVertically,
// ) {
// Row(
// verticalAlignment = Alignment.CenterVertically,
// ) {
// Image(
// painter = painterResource(id = R.drawable.unknown),
// contentDescription = stringResource(id = R.string.unknown_check),
// modifier = Modifier.padding(end = 5.dp),
// )
// Text(
// text = "Generate mDL",
// fontFamily = Inter,
// fontWeight = FontWeight.Medium,
// fontSize = 17.sp,
// color = ColorStone950,
// modifier = Modifier.padding(bottom = 5.dp, top = 5.dp),
// )
// }
//
// Image(
// painter = painterResource(id = R.drawable.chevron),
// contentDescription = stringResource(id = R.string.chevron),
// modifier = Modifier.scale(0.5f)
// )
// }
//
// Text(
// text = "Generate a fresh test mDL issued by the SpruceID Test CA",
// fontFamily = Inter,
// fontWeight = FontWeight.Normal,
// fontSize = 15.sp,
// color = ColorStone600,
// )
// }
// }

Image(
painter = painterResource(id = R.drawable.chevron),
contentDescription = stringResource(id = R.string.chevron),
modifier = Modifier.scale(0.5f)
)
}

Text(
text = "Generate a fresh test mDL issued by the SpruceID Test CA",
fontFamily = Inter,
fontWeight = FontWeight.Normal,
fontSize = 15.sp,
color = ColorStone600,
)
}
}
Spacer(Modifier.weight(1f))
Button(
onClick = {
Expand Down

0 comments on commit fb6396a

Please sign in to comment.