diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt index e48ecd21a..98c774e51 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditRoute.kt @@ -40,6 +40,11 @@ fun ProfileEditRoute( val profileEditState by viewModel.state.collectAsStateWithLifecycle() val lifecycleOwner = LocalLifecycleOwner.current + + LaunchedEffect(key1 = true) { + viewModel.updateName(initialName) + } + if (profileEditState.showBottomSheet) { SignUpBottomSheet( onDismiss = { viewModel.updateBottomSheet(false) }, @@ -69,7 +74,7 @@ fun ProfileEditRoute( viewModel.isInputValid(editName) }, onSaveClick = {/*TODO: 수정사항 저장 로직*/ }, - name = initialName, + name = profileEditState.name, onBackButtonClick = { viewModel.navigateUp() } ) } diff --git a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt index e4e955266..a8fa3c8ff 100644 --- a/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/profileedit/ProfileEditViewModel.kt @@ -84,7 +84,7 @@ class ProfileEditViewModel @Inject constructor() : ViewModel() { _state.value = _state.value.copy(showBottomSheet = isVisible) } - fun updateName(name: String){ + fun updateName(name: String) { _state.value = _state.value.copy(name = name) }