Skip to content

Commit

Permalink
[rename] #107 중복체크 버튼 클릭 상태를 갖고 있는 stateflow 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeha committed Aug 11, 2023
1 parent 183c978 commit e81a471
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class NicknameViewModel @Inject constructor(
private val _isTextChanged = MutableStateFlow(false)
val isTextChanged: StateFlow<Boolean> = _isTextChanged.asStateFlow()

private val _isClickedCheckBtn = MutableStateFlow(false)
val isClickedCheckBtn: StateFlow<Boolean> = _isClickedCheckBtn.asStateFlow()
private val _isCheckBtnClicked = MutableStateFlow(false)
val isCheckBtnClicked: StateFlow<Boolean> = _isCheckBtnClicked.asStateFlow()

fun getNicknameDuplicateCheck() {
viewModelScope.launch {
Expand All @@ -76,7 +76,7 @@ class NicknameViewModel @Inject constructor(
}

fun updateDuplicateCheckButtonState(state: Boolean) { // updated in Activity
_isClickedCheckBtn.value = state
_isCheckBtnClicked.value = state
}

private fun updateInputUiState(nickname: String): InputUiState {
Expand All @@ -89,7 +89,7 @@ class NicknameViewModel @Inject constructor(
}

// 텍스트가 바뀌었는데 중복체크를 하지 않은 경우
if (isTextChanged.value && !isClickedCheckBtn.value) {
if (isTextChanged.value && !isCheckBtnClicked.value) {
return InputUiState.Failure(CODE_UNCHECKED_DUPLICATION)
}

Expand Down

0 comments on commit e81a471

Please sign in to comment.