Skip to content

Commit

Permalink
[refactor] #290 delay -> runnable post 로 변경해 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
sxunea committed May 18, 2024
1 parent e59b8d0 commit 0c20bb7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import androidx.fragment.app.activityViewModels
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
Expand Down Expand Up @@ -285,13 +283,15 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
when (state) {
is UiState.Success -> {
dismissLoadingProgressBar()
delay(100)
val data = dataStoreRepository.getUserInfo().first() ?: return@launch
updateUserInfo(data)
setUpUserGoalByLevel(data)
setUpUserDataByGoal(data)
animate2weeksSaveGraph(data.amountSavedTwoWeeks)
animate2weeksSpendGraph(data.amountSpentTwoWeeks)
binding.root.post {
state.data?.let {
updateUserInfo(it)
setUpUserGoalByLevel(it)
setUpUserDataByGoal(it)
animate2weeksSaveGraph(it.amountSavedTwoWeeks)
animate2weeksSpendGraph(it.amountSpentTwoWeeks)
}
}
}

is UiState.Failure -> {
Expand Down

0 comments on commit 0c20bb7

Please sign in to comment.