From c1879dfdc879667f5dcc39d220bf6ad39152f76e Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Thu, 8 Aug 2024 17:51:38 +0800 Subject: [PATCH] Style(LibrariesScreenViewModel): Reformat code --- .../toolbox/ui/about/LibrariesScreenViewModel.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/about/LibrariesScreenViewModel.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/about/LibrariesScreenViewModel.kt index 351d5df..8932f34 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/about/LibrariesScreenViewModel.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/about/LibrariesScreenViewModel.kt @@ -26,11 +26,11 @@ class LibrariesScreenViewModel @Inject constructor( @OptIn(ExperimentalCoroutinesApi::class) val librariesScreenUiState: StateFlow = depRepository.getSearchNameCount() - .flatMapLatest {totalCount -> + .flatMapLatest { totalCount -> if (totalCount < SEARCH_MIN_COUNT) { flowOf(LibrariesScreenUiState.Nothing) } else { - searchValue.flatMapLatest {value -> + searchValue.flatMapLatest { value -> depRepository.searchName(value).map { if (it.libraries.isEmpty()) { LibrariesScreenUiState.NotFound @@ -53,11 +53,11 @@ class LibrariesScreenViewModel @Inject constructor( } sealed interface LibrariesScreenUiState { - data object Loading: LibrariesScreenUiState + data object Loading : LibrariesScreenUiState - data object Nothing: LibrariesScreenUiState + data object Nothing : LibrariesScreenUiState - data object NotFound: LibrariesScreenUiState + data object NotFound : LibrariesScreenUiState data class Success(val dependencies: Dependencies) : LibrariesScreenUiState }