Skip to content

Commit 2f44fb2

Browse files
committed
🐛 Flow들을 viewLifecycle 범위에서 수집하도록 수정
1 parent 85d2487 commit 2f44fb2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

presentation/src/main/java/com/whyranoid/presentation/community/group/CreateGroupFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ internal class CreateGroupFragment :
2929

3030
setupMenu()
3131

32-
repeatWhenUiStarted {
32+
viewLifecycleOwner.repeatWhenUiStarted {
3333
viewModel.eventFlow.collect { event ->
3434
handleEvent(event)
3535
}
3636
}
3737

38-
repeatWhenUiStarted {
38+
viewLifecycleOwner.repeatWhenUiStarted {
3939
viewModel.rules.collect {
4040
println("테스트 $it")
4141
}
@@ -105,7 +105,7 @@ internal class CreateGroupFragment :
105105
}
106106
}
107107

108-
repeatWhenUiStarted {
108+
viewLifecycleOwner.repeatWhenUiStarted {
109109
viewModel.isButtonEnable.collect { isEnable ->
110110
if (isEnable) {
111111
binding.topAppBar.menu.setGroupVisible(R.id.ready_to_create, true)

presentation/src/main/java/com/whyranoid/presentation/community/group/detail/GroupDetailFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal class GroupDetailFragment :
6666
}
6767

6868
private fun handleEvent() {
69-
repeatWhenUiStarted {
69+
viewLifecycleOwner.repeatWhenUiStarted {
7070
viewModel.eventFlow.collect { event ->
7171
when (event) {
7272
// TODO : 홍보 글 쓰러가기
@@ -105,7 +105,7 @@ internal class GroupDetailFragment :
105105
val notificationAdapter = GroupNotificationAdapter("hsjeon")
106106

107107
binding.notificationRecyclerView.adapter = notificationAdapter
108-
repeatWhenUiStarted {
108+
viewLifecycleOwner.repeatWhenUiStarted {
109109
viewModel.mergedNotifications.collect { notifications ->
110110
notificationAdapter.submitList(notifications)
111111
}

0 commit comments

Comments
 (0)