|
|
@ -78,10 +78,10 @@ class SearchViewModel @Inject constructor(
|
|
|
|
val recentSearchQueriesUiState: StateFlow<RecentSearchQueriesUiState> =
|
|
|
|
val recentSearchQueriesUiState: StateFlow<RecentSearchQueriesUiState> =
|
|
|
|
recentSearchQueriesUseCase().map(RecentSearchQueriesUiState::Success)
|
|
|
|
recentSearchQueriesUseCase().map(RecentSearchQueriesUiState::Success)
|
|
|
|
.stateIn(
|
|
|
|
.stateIn(
|
|
|
|
scope = viewModelScope,
|
|
|
|
scope = viewModelScope,
|
|
|
|
started = SharingStarted.WhileSubscribed(5_000),
|
|
|
|
started = SharingStarted.WhileSubscribed(5_000),
|
|
|
|
initialValue = RecentSearchQueriesUiState.Loading,
|
|
|
|
initialValue = RecentSearchQueriesUiState.Loading,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
fun onSearchQueryChanged(query: String) {
|
|
|
|
fun onSearchQueryChanged(query: String) {
|
|
|
|
savedStateHandle[SEARCH_QUERY] = query
|
|
|
|
savedStateHandle[SEARCH_QUERY] = query
|
|
|
|