Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix/#226] 프로필 수정 뷰 / 서버통신 수정 #228

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FEAT/#226] 마이페이지 정보 불러오는 타이밍 수정
  • Loading branch information
leeeyubin committed Sep 8, 2024
commit 8d630a478aefc23d98616b43b324d9374e4d4460
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ fun MyPageRoute(
}
}

LaunchedEffect(true) {
viewModel.getProfile()
}

LaunchedEffect(viewModel.sideEffects, lifecycleOwner) {
viewModel.sideEffects.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle)
.collect { sideEffect ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class MyPageViewModel @Inject constructor(
private val tokenRepository: TokenRepository
) : ViewModel() {

init {
getProfile()
}

private val _state: MutableStateFlow<MyPageState> = MutableStateFlow(MyPageState())
val state: StateFlow<MyPageState> get() = _state.asStateFlow()

Expand Down Expand Up @@ -98,7 +94,7 @@ class MyPageViewModel @Inject constructor(
}
}

private fun getProfile() {
fun getProfile() {
viewModelScope.launch {
myPageRepository.getProfile()
.onSuccess { response ->
Expand Down