Skip to content

Commit f7b6b47

Browse files
committed
chore(flipcash): add back fetch since latest for pools; update end of paging trigger
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 7a1c216 commit f7b6b47

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/flipcash/shared/persistence/sources/src/main/kotlin/com/flipcash/app/persistence/sources/mediator/PoolRemoteMediator.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class PoolRemoteMediator @Inject constructor(
4747

4848
val pools = controller.getPagedPools(queryOptions).getOrNull().orEmpty()
4949

50+
val limit = state.config.pageSize
51+
5052
withContext(Dispatchers.IO) {
5153
if (loadType == LoadType.REFRESH) {
5254
dataSource.clear()
@@ -55,7 +57,7 @@ class PoolRemoteMediator @Inject constructor(
5557
dataSource.upsert(pools)
5658
}
5759

58-
MediatorResult.Success(endOfPaginationReached = pools.isEmpty())
60+
MediatorResult.Success(endOfPaginationReached = pools.size < limit)
5961
} catch (e: Exception) {
6062
MediatorResult.Error(e)
6163
}

apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,14 @@ class RealSessionController @Inject constructor(
333333
}
334334
}
335335

336-
private fun bringPoolsCurrent(count: Int = 100) {
336+
private fun bringPoolsCurrent(count: Int = 10) {
337337
if (userManager.authState.canAccessAuthenticatedApis) {
338338
scope.launch {
339339
poolsCoordinator.updatePools()
340340
}
341+
scope.launch {
342+
poolsCoordinator.fetchSinceLatest(count)
343+
}
341344
}
342345
}
343346

0 commit comments

Comments
 (0)