Skip to content

Commit

Permalink
add fixes from suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Swapnil Tripathi <[email protected]>
  • Loading branch information
swaptr committed Nov 23, 2023
1 parent d32da29 commit ef1287e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,8 @@ class AppDemoController : ViewModel() {
onConnectionComplete = onComplete
}

fun subscribeToShowDialog(onShowDialog: () -> Unit) {
onOfferReceived = onShowDialog
}

fun processOfferRequest() {
viewModelScope.launch {
suspend fun processOfferRequest() {
withContext(Dispatchers.IO) {
holder?.prepareCredentialRequest(profile!!, "4xE68b6S5VRFrKMMG1U95M")
Log.d("HOLDER", "processOfferRequest: ${holder?.getState()}")
val message = holder?.getMsgCredentialRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ fun HolderScreen(
) {
val demoState by demoController.states.collectAsState()
val scope = rememberCoroutineScope()
val context = LocalContext.current

LaunchedEffect(Unit) {
demoController.awaitCredentialPolling()
}

LaunchedEffect(Unit) {
demoController.awaitCredentialPolling()
Expand All @@ -39,7 +34,7 @@ fun HolderScreen(
if (demoState.offerReceived) {
AlertDialog(
onDismissRequest = { },
title = { Text("Accept this invitation?") },
title = { Text("Accept this credential?") },
text = { Text(demoController.getHolder()?.getAttributes()!!) },
confirmButton = {
TextButton(onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.io.FileWriter
fun prepareGenesisFile(context: Context): File {
val file = File(context.filesDir, "genesis")
if (!file.exists()) {
val transactions = context.resources.openRawResource(R.raw.transactions).bufferedReader()
val transactions = context.resources.openRawResource(R.raw.bcovrin_transactions).bufferedReader()
.use { it.readText() }
val bufferedWriter = BufferedWriter(FileWriter(file))
bufferedWriter.write(transactions)
Expand Down

0 comments on commit ef1287e

Please sign in to comment.