Skip to content

Commit

Permalink
Merge pull request #191 from team-winey/feature/feat-mypage-datastore
Browse files Browse the repository at this point in the history
[feat] λ§ˆμ΄νŽ˜μ΄μ§€ / λ§ˆμ΄νŽ˜μ΄μ§€ μ§„μž… μ‹œ μ„œλ²„μ™€μ˜ 톡신 이전에 λ°μ΄ν„°μŠ€ν† μ–΄μ— μ €μž₯된 정보 좜λ ₯
  • Loading branch information
Sangwook123 authored Sep 9, 2023
2 parents 7f258c2 + 86041ac commit 40a8d61
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import org.go.sopt.winey.R
import org.go.sopt.winey.databinding.FragmentMyPageBinding
import org.go.sopt.winey.domain.entity.User
Expand Down Expand Up @@ -50,6 +51,8 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
amplitudeUtils.logEvent("view_mypage")

initUserData()
initNavigation()
init1On1ButtonClickListener()
initTermsButtonClickListener()
Expand Down Expand Up @@ -84,6 +87,16 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
mainViewModel.getUser()
}

private fun initUserData() {
viewLifeCycleScope.launch {
val data = dataStoreRepository.getUserInfo().first()
if (data != null) {
updateUserInfo(data)
initTargetModifyButtonClickListener(data)
}
}
}

private fun initNicknameButtonClickListener() {
binding.ivMypageNickname.setOnClickListener {
amplitudeUtils.logEvent("click_edit_nickname")
Expand Down

0 comments on commit 40a8d61

Please sign in to comment.