Skip to content
Snippets Groups Projects
Commit 93c66033 authored by Taras's avatar Taras
Browse files

Add notifiable await paging to timeline

parent 68a9c23f
No related branches found
No related tags found
No related merge requests found
......@@ -142,4 +142,10 @@ interface Timeline {
*/
BACKWARDS
}
/**
* This is the same than the regular paginate method, will will call the onTimelineUpdated
* Added for Circles
*/
suspend fun awaitPaginateWithTimelineUpdate(direction: Direction, count: Int): List<TimelineEvent>
}
......@@ -422,4 +422,16 @@ internal class DefaultTimeline(
}
}
}
//Added for Circles
override suspend fun awaitPaginateWithTimelineUpdate(direction: Timeline.Direction, count: Int): List<TimelineEvent> {
startTimelineJob?.join()
withContext(timelineDispatcher) {
val postSnapshot = loadMore(count, direction, fetchOnServerIfNeeded = true)
if (postSnapshot) {
postSnapshot()
}
}
return getSnapshot()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment