Skip to content

Commit

Permalink
[fix/design_detail]: GroupList 옵저빙 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dogdduddy authored and Jim-swit committed Mar 18, 2024
1 parent 8c47918 commit 61d0f36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener {
private fun setGroup() {
binding.groupArrow.setOnClickListener {
lifecycleScope.launch {
viewModel.getMyGroup().let { groupList ->
viewModel.setGroupList(groupList)
}
viewModel.requestGroupList()
}

BottomSheetDialog(requireContext())
Expand Down Expand Up @@ -437,16 +435,8 @@ class HomeFragment : Fragment(), ViewHolderBindListener {
viewModel.setSortType(SortType.DISTANCE)
}

repeatWhenUiStarted {
viewModel.myGroupList.collect {
binding.groupName.text
}
}

lifecycleScope.launch {
viewModel.getMyGroup().let { groupList ->
viewModel.setGroupList(groupList)
}
viewModel.requestGroupList()
}

repeatWhenUiStarted {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ class HomeViewModel @Inject constructor(
return getRestaurantMapWithLimitCountUseCase(sortType, group)
}

suspend fun getMyGroup(): List<Group> {
return getMyGroupUseCase()
suspend fun requestGroupList() {
_myGroupList.value = ResultState.OnSuccess(getMyGroupUseCase())
}

suspend fun selectGroup(groupID: Int) {
Expand Down

0 comments on commit 61d0f36

Please sign in to comment.