File tree Expand file tree Collapse file tree
apps/flipcash/shared/payments
src/main/kotlin/com/flipcash/app/payments/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ dependencies {
5050 implementation(Libs .androidx_localbroadcastmanager)
5151
5252 implementation(project(" :apps:flipcash:core" ))
53+ implementation(project(" :apps:flipcash:shared:activityfeed" ))
5354 implementation(project(" :libs:messaging" ))
5455 implementation(project(" :ui:components" ))
5556 implementation(project(" :ui:resources" ))
Original file line number Diff line number Diff line change 11package com.flipcash.app.payments.internal
22
3+ import com.flipcash.app.activityfeed.ActivityFeedCoordinator
34import com.flipcash.app.core.pools.Pool
45import com.flipcash.app.payments.delegates.PoolBidDelegate
56import com.flipcash.services.user.UserManager
@@ -19,6 +20,7 @@ internal class InternalPoolBidDelegate @Inject constructor(
1920 private val exchange : Exchange ,
2021 private val transactionController : TransactionController ,
2122 private val userManager : UserManager ,
23+ private val activityFeedCoordinator : ActivityFeedCoordinator ,
2224): PoolBidDelegate {
2325 override suspend fun payForBid (
2426 pool : Pool ,
@@ -50,6 +52,7 @@ internal class InternalPoolBidDelegate @Inject constructor(
5052 source = userManager.accountCluster!! ,
5153 ).map { it.id.bytes }.onSuccess {
5254 // update balance on successful bid payment
55+ activityFeedCoordinator.fetchSinceLatest()
5356 balanceController.subtract(localizedAmount)
5457 onSuccess(it)
5558 }.onFailure {
Original file line number Diff line number Diff line change 11package com.flipcash.app.payments.internal
22
3+ import com.flipcash.app.activityfeed.ActivityFeedCoordinator
34import com.flipcash.app.core.pools.Pool
45import com.flipcash.app.core.pools.PoolBet
56import com.flipcash.app.core.pools.PoolBetOutcome
@@ -33,6 +34,7 @@ class InternalPoolResolveDelegate @Inject constructor(
3334 private val userManager : UserManager ,
3435 private val accountController : AccountController ,
3536 private val exchange : Exchange ,
37+ private val activityFeedCoordinator : ActivityFeedCoordinator ,
3638) : PoolResolveDelegate {
3739 override suspend fun resolvePool (
3840 pool : Pool ,
@@ -83,6 +85,8 @@ class InternalPoolResolveDelegate @Inject constructor(
8385 if (balanceIncrement != null ) {
8486 balanceController.add(balanceIncrement)
8587 }
88+ // update balance on successful bid payment
89+ activityFeedCoordinator.fetchSinceLatest()
8690 onSuccess(it)
8791 }.onFailure {
8892 onError(it)
You can’t perform that action at this time.
0 commit comments