diff --git a/core/src/main/java/org/futo/circles/core/feature/timeline/data_source/BaseTimelineDataSource.kt b/core/src/main/java/org/futo/circles/core/feature/timeline/data_source/BaseTimelineDataSource.kt index 0cceea12806916a6ccc0be4a95af5b7d4e65cd80..f14aa53d230f4343e28ffe3f21790fdb2c592275 100644 --- a/core/src/main/java/org/futo/circles/core/feature/timeline/data_source/BaseTimelineDataSource.kt +++ b/core/src/main/java/org/futo/circles/core/feature/timeline/data_source/BaseTimelineDataSource.kt @@ -5,6 +5,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow +import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.mapLatest @@ -57,6 +58,7 @@ abstract class BaseTimelineDataSource( startTimeline(listener) awaitClose() }.flowOn(Dispatchers.IO) + .debounce(150) .mapLatest { val items = timelineBuilder.build(it, isThread) if (it.isNotEmpty() && items.size <= LOAD_MORE_THRESHOLD) loadMore()