mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 20:58:26 +00:00
Cleanup
This commit is contained in:
parent
f6d21534e0
commit
0146a2975f
@ -17,7 +17,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import network.loki.messenger.databinding.ViewGlobalSearchInputBinding
|
||||
|
||||
|
||||
class GlobalSearchInputLayout @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null
|
||||
) : LinearLayout(context, attrs),
|
||||
|
@ -2,9 +2,7 @@ package org.thoughtcrime.securesms.home.search
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.channels.BufferOverflow
|
||||
import kotlinx.coroutines.delay
|
||||
@ -15,14 +13,10 @@ import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.mapLatest
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.plus
|
||||
|
||||
import org.session.libsignal.utilities.SettableFuture
|
||||
|
||||
import org.thoughtcrime.securesms.search.SearchRepository
|
||||
import org.thoughtcrime.securesms.search.model.SearchResult
|
||||
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
@ -51,7 +45,7 @@ class GlobalSearchViewModel @Inject constructor(private val searchRepository: Se
|
||||
SearchResult.EMPTY
|
||||
} else {
|
||||
// User input delay in case we get a new query within a few hundred ms this
|
||||
// coroutine will be cancelled and expensive query will not be run
|
||||
// coroutine will be cancelled and the expensive query will not be run.
|
||||
delay(300)
|
||||
|
||||
val settableFuture = SettableFuture<SearchResult>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user