Skip to content

Commit 37da2a1

Browse files
committed
chore(flipcash/pools): fetch updated pool after placing a bet
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 7014039 commit 37da2a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/flipcash/shared/pools/src/main/kotlin/com/flipcash/app/pools/PoolsCoordinator.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ class PoolsCoordinator @Inject constructor(
188188
metadata = metadata,
189189
).onSuccess {
190190
dataSource.upsertBet(poolId, it, false)
191-
}.map { it.id }
191+
}.fold(
192+
onSuccess = { bet ->
193+
getPool(poolId).map { bet.id }
194+
},
195+
onFailure = { Result.failure(it) }
196+
)
192197
}
193198

194199
suspend fun onBetPaidForInPool(poolId: ID): Result<Unit> {

0 commit comments

Comments
 (0)