mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
rust sdk : handle api breaks for 0.2.59
This commit is contained in:
+3
-1
@@ -28,6 +28,8 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import javax.inject.Inject
|
||||
|
||||
private const val SEARCH_BATCH_SIZE = 20
|
||||
|
||||
class RoomDirectoryPresenter @Inject constructor(
|
||||
private val dispatchers: CoroutineDispatchers,
|
||||
private val roomDirectoryService: RoomDirectoryService,
|
||||
@@ -51,7 +53,7 @@ class RoomDirectoryPresenter @Inject constructor(
|
||||
loadingMore = false
|
||||
// debounce search query
|
||||
delay(300)
|
||||
roomDirectoryList.filter(searchQuery, 20)
|
||||
roomDirectoryList.filter(filter = searchQuery, batchSize = SEARCH_BATCH_SIZE, viaServerName = null)
|
||||
}
|
||||
LaunchedEffect(loadingMore) {
|
||||
if (loadingMore) {
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@ import org.junit.Test
|
||||
|
||||
@Test
|
||||
fun `present - emit search event`() = runTest {
|
||||
val filterLambda = lambdaRecorder { _: String?, _: Int ->
|
||||
val filterLambda = lambdaRecorder { _: String?, _: Int, _: String? ->
|
||||
Result.success(Unit)
|
||||
}
|
||||
val roomDirectoryList = FakeRoomDirectoryList(filterLambda = filterLambda)
|
||||
@@ -99,7 +99,7 @@ import org.junit.Test
|
||||
}
|
||||
assert(filterLambda)
|
||||
.isCalledOnce()
|
||||
.with(value("test"), any())
|
||||
.with(value("test"), any(), value(null))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user