Skip to content

Commit 390baea

Browse files
bngshyonghanJu
andcommitted
🐛 repeatOnLifecycle의 lifecycleOwner 수정
Co-authored-by: yonghanJu <[email protected]>
1 parent 48b7cfa commit 390baea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

presentation/src/main/java/com/whyranoid/presentation/runningstart/RunningStartFragment.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ internal class RunningStartFragment :
6666
super.onViewCreated(view, savedInstanceState)
6767
binding.vm = viewModel
6868

69-
repeatWhenUiStarted {
69+
observeState()
70+
}
71+
72+
private fun observeState() {
73+
viewLifecycleOwner.repeatWhenUiStarted {
7074
viewModel.runnerCount.collect { runnerCount ->
7175
binding.tvRunnerCountNumber.text = runnerCount.toString()
7276
}
7377
}
7478

75-
repeatWhenUiStarted {
79+
viewLifecycleOwner.repeatWhenUiStarted {
7680
viewModel.eventFlow.collect { event ->
7781
handleEvent(event)
7882
}

0 commit comments

Comments
 (0)