Skip to content

Commit

Permalink
Fix: 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Moony-H authored and inwoo13 committed Nov 28, 2024
1 parent c46c75f commit 8593b0d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 8593b0d

Please sign in to comment.