Skip to content

Commit

Permalink
Merge pull request #298 from team-winey/refactor/mod-mypage-delay
Browse files Browse the repository at this point in the history
[refactor] λ§ˆμ΄νŽ˜μ΄μ§€ / λ‘œλ”©ν”„λ‘œκ·Έλ ˆμŠ€λ°” - μ• λ‹ˆλ©”μ΄μ…˜ κ°„μ˜ μ‹€ν–‰μˆœμ„œ 보μž₯ 둜직 κ°œμ„ 
  • Loading branch information
sxunea authored Jun 2, 2024
2 parents 91d993d + 894bf58 commit 10d0881
Showing 1 changed file with 8 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,14 @@ 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 {
val data = state.data ?: return@post
updateUserInfo(data)
setUpUserGoalByLevel(data)
setUpUserDataByGoal(data)
animate2weeksSaveGraph(data.amountSavedTwoWeeks)
animate2weeksSpendGraph(data.amountSpentTwoWeeks)
}
}

is UiState.Failure -> {
Expand Down

0 comments on commit 10d0881

Please sign in to comment.