File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ class ActivityRepo @Inject constructor(
451451 suspend fun addTagsToTransaction (
452452 paymentHashOrTxId : String ,
453453 type : ActivityFilter ,
454- txType : PaymentType ,
454+ txType : PaymentType ? ,
455455 tags : List <String >,
456456 ): Result <Unit > = withContext(bgDispatcher) {
457457 if (tags.isEmpty()) return @withContext Result .failure(IllegalArgumentException (" No tags selected" ))
@@ -460,7 +460,7 @@ class ActivityRepo @Inject constructor(
460460 type = type,
461461 txType = txType
462462 ).onSuccess { activity ->
463- return @withContext addTagsToActivity(activity.rawId(), tags = tags)
463+ addTagsToActivity(activity.rawId(), tags = tags)
464464 }.onFailure { e ->
465465 return @withContext Result .failure(e)
466466 }.map { Unit }
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import kotlinx.coroutines.flow.debounce
1515import kotlinx.coroutines.launch
1616import kotlinx.coroutines.withContext
1717import to.bitkit.di.BgDispatcher
18- import to.bitkit.ext.rawId
1918import to.bitkit.repositories.ActivityRepo
2019import to.bitkit.repositories.WalletRepo
2120import to.bitkit.services.CoreService
@@ -250,17 +249,13 @@ class ActivityListViewModel @Inject constructor(
250249 viewModelScope.launch {
251250 walletRepo.getAllInvoiceTags().onSuccess { invoiceTags ->
252251 invoiceTags.forEach { tagEntity ->
253- activityRepo.findActivityByPaymentId (
252+ activityRepo.addTagsToTransaction (
254253 paymentHashOrTxId = tagEntity.paymentHash,
255254 type = ActivityFilter .ALL ,
256- txType = null
257- ).onSuccess { activity ->
258- activityRepo.addTagsToActivity(
259- activityId = activity.rawId(),
260- tags = tagEntity.tags
261- ).onSuccess {
262- walletRepo.deleteInvoice(tagEntity.paymentHash)
263- }
255+ txType = null ,
256+ tags = tagEntity.tags
257+ ).onSuccess {
258+ walletRepo.deleteInvoice(tagEntity.paymentHash)
264259 }
265260 }
266261 }
You can’t perform that action at this time.
0 commit comments