Skip to content

Commit

Permalink
[chore] 코드리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwon2724 committed Aug 6, 2024
1 parent 5c74c2d commit 8769c53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ class SettingViewModel @Inject constructor(
) : ViewModel() {
private var duplicateNicknameJob: Job? = null

private val _isBottomSheetHide: MutableState<Boolean> = mutableStateOf(false)
val isBottomSheetHide: Boolean
get() = _isBottomSheetHide.value
private val _isBottomSheetVisible: MutableState<Boolean> = mutableStateOf(false)
val isBottomSheetVisible: Boolean
get() = _isBottomSheetVisible.value

private val _inputNicknameState = MutableStateFlow(DuplicateNicknameState())
val inputNicknameState: StateFlow<DuplicateNicknameState>
get() = _inputNicknameState.asStateFlow()

fun changeBottomSheetHideState() {
_isBottomSheetHide.value = !_isBottomSheetHide.value
_isBottomSheetVisible.value = !_isBottomSheetVisible.value
}

fun inputText(inputNickname: String) {
Expand All @@ -61,15 +61,14 @@ class SettingViewModel @Inject constructor(
}

fun editNickname() {
Log.d("!! : ", "call")
viewModelScope.launch {
when (val editNicknameResult = editNicknameUseCase.editNickname(_inputNicknameState.value.nickname)) {
is PokitResult.Success -> {
Log.d("!! : ", editNicknameResult.result.toString())

}

is PokitResult.Error -> {
Log.d("!! : ", editNicknameResult.error.toString())

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun SettingsScreen(
// TODO 회원탈퇴 분기
PokitBottomSheet(
onHideBottomSheet = { },
show = settingViewModel.isBottomSheetHide
show = settingViewModel.isBottomSheetVisible
) {
TwoButtonBottomSheetContent(
title = stringResource(id = StringResource.logout_title),
Expand Down

0 comments on commit 8769c53

Please sign in to comment.