From 8593b0df0f728a34583f52e40130b7b16960f9d3 Mon Sep 17 00:00:00 2001 From: Moony-H <53536205+Moony-H@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:01:17 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/kolown/search/SearchViewModel.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/feature/search/src/main/java/com/kolown/search/SearchViewModel.kt b/feature/search/src/main/java/com/kolown/search/SearchViewModel.kt index 8f8ff1e9..9e7a60af 100644 --- a/feature/search/src/main/java/com/kolown/search/SearchViewModel.kt +++ b/feature/search/src/main/java/com/kolown/search/SearchViewModel.kt @@ -40,15 +40,14 @@ class SearchViewModel @Inject constructor( tagRepository.getTagBySearch(it) }.cachedIn(viewModelScope) - fun setSearchQuery(searchText: String) { + fun setSearchQuery(searchText: String) { _searchQuery.value = searchText } - fun setTag(tag: Tag) { - Log.e("test", "set tag: ${tag.name}") _tag.value = tag + _searchQuery.value = "# ${tag.name}" } @OptIn(ExperimentalCoroutinesApi::class) @@ -58,7 +57,7 @@ class SearchViewModel @Inject constructor( tag?.let { postRepository.getPostBySearch(tag.id) .onStart { emit(PagingData.empty()) } - } ?: flow { emit(PagingData.empty())} + } ?: flow { emit(PagingData.empty()) } } companion object {