Skip to content

Commit

Permalink
[FIX/#206] state 관리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Aug 28, 2024
1 parent eb8f82b commit bfbd58a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down Expand Up @@ -69,7 +74,7 @@ fun ProfileEditRoute(
viewModel.isInputValid(editName)
},
onSaveClick = {/*TODO: 수정사항 저장 로직*/ },
name = initialName,
name = profileEditState.name,
onBackButtonClick = { viewModel.navigateUp() }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bfbd58a

Please sign in to comment.