-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 내정보 수정 > EditText 입력 오류 수정 #359
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
Merged
+13
−14
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c086ad0
feat: TextWatcher → doAfterTextChanged 로 교체 및 닉네임 수정 오류 해결
kangyuri1114 ef16d0a
feat: 중복확인 버튼 클릭 시 이전에 입력한 닉네임으로 깜빡임 문제 해결
kangyuri1114 d410114
feat: 다시 addTextChangedListener 도입으로 롤백
kangyuri1114 edcadf4
feat: 안쓰는 import 정리
kangyuri1114 e120d53
feat: state -> it으로 수정
kangyuri1114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,7 @@ class UserInfoViewModel @Inject constructor( | |
| fun checkNickname(inputNickname: String) { | ||
| viewModelScope.launch { | ||
| validateUserNameUseCase(inputNickname).onStart { | ||
| _uiState.update { it.copy(loading = true) } | ||
| _uiState.update { it.copy(loading = true, nickname = inputNickname) } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xml 안에 id 변경으로 인한 수정 말고는 이 수정이 다 인거죵?! |
||
| }.onCompletion { | ||
| _uiState.update { it.copy(loading = false) } | ||
| }.catch { e -> | ||
|
|
@@ -76,15 +76,13 @@ class UserInfoViewModel @Inject constructor( | |
| isEnableName = true, | ||
| toastMessage = "사용가능한 닉네임 입니다.", | ||
| isNicknameChecked = true, | ||
| nickname = inputNickname, | ||
| ) | ||
| } | ||
| } else { | ||
| _uiState.update { | ||
| it.copy( | ||
| isEnableName = false, | ||
| toastMessage = "이미 사용 중인 닉네임 입니다.", | ||
| nickname = inputNickname, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 클릭 리스너 내에서
uiState를 구독하는 로직(110-126행)은 개선이 필요해 보입니다. 클릭할 때마다 새로운collectLatest코루틴을 시작하는 것은 안티패턴이며, 여러 구독으로 인해 비효율적이고 예측 불가능한 동작을 유발할 수 있습니다.이 Activity에 이미 여러
uiState구독이 존재하므로(onCreate,collectButtonEnableState,collectUIState), 모든 UI 업데이트를 처리하는 단일 구독으로 통합하는 것을 강력히 권장합니다.닉네임 중복 확인 결과와 같은 일회성 이벤트를 처리하기 위해서는 ViewModel에서
SharedFlow를 사용하는 패턴을 고려해볼 수 있습니다. 이렇게 하면 UI 로직이 더 명확해지고 관리하기 쉬워집니다.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 해당 액티비티에 uistate 도입 리팩토링 때 같이 수정하겠씁니다!