Skip to content

Commit a14fcee

Browse files
committed
feat: compare activity id
1 parent f109c08 commit a14fcee

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,17 @@ class AppViewModel @Inject constructor(
512512
return@launch
513513
}
514514

515-
//TODO COMPARE PAYMENT HASH AND TX ID
516-
517515
when (activity) {
518-
is Activity.Lightning -> coreService.activity.appendTags(
519-
toActivityId = activity.v1.id,
520-
tags = _sendUiState.value.selectedTags
521-
)
516+
is Activity.Lightning -> {
517+
if (paymentHashOrTxId == activity.v1.id) {
518+
coreService.activity.appendTags(
519+
toActivityId = activity.v1.id,
520+
tags = _sendUiState.value.selectedTags
521+
)
522+
} else {
523+
Logger.error("Different activity id. Expected: $paymentHashOrTxId found: ${activity.v1.id}")
524+
}
525+
}
522526

523527
is Activity.Onchain -> {
524528
if (paymentHashOrTxId == activity.v1.txId) {
@@ -527,7 +531,7 @@ class AppViewModel @Inject constructor(
527531
tags = _sendUiState.value.selectedTags
528532
)
529533
} else {
530-
Logger.error("Different tcId. Expected: $paymentHashOrTxId found: ${activity.v1.txId}")
534+
Logger.error("Different txId. Expected: $paymentHashOrTxId found: ${activity.v1.txId}")
531535
}
532536
}
533537
}

0 commit comments

Comments
 (0)