@@ -190,26 +190,43 @@ private extension NickNameSettingFeature {
190190 func handleInnerAction( _ action: Action . InnerAction , state: inout State ) -> Effect < Action > {
191191 switch action {
192192 case . 닉네임_텍스트_변경되었을때:
193- /// [1]. 닉네임 텍스트필드가 비어있을 때
193+ /// [1]. 닉네임 변경 X, 현재 프로필이 nil이면서 프로필을 선택했을 때 -> 버튼 활성화
194+ if let currentNickName = state. user? . nickname,
195+ let _ = state. selectedProfile {
196+ if currentNickName == state. text &&
197+ state. user? . profile == nil {
198+ state. buttonState = . filled( . primary)
199+ return . none
200+ }
201+ }
202+ /// [2]. 닉네임 변경 X,, 프로필만 변경했을 때 -> 버튼 활성화
203+ if let currentNickName = state. user? . nickname,
204+ let currentProfile = state. user? . profile,
205+ let selectedProfile = state. selectedProfile {
206+ if currentNickName == state. text && currentProfile != selectedProfile {
207+ state. buttonState = . filled( . primary)
208+ return . none
209+ }
210+ }
211+ /// [3]. 닉네임 텍스트필드가 비어있을 때
194212 if state. text. isEmpty {
195213 state. buttonState = . disable
196214 return . none
197215 }
198- /// [2 ]. 닉네임이 10자를 넘을 때
216+ /// [4 ]. 닉네임이 10자를 넘을 때
199217 if state. text. count > 10 {
200218 state. buttonState = . disable
201219 state. textfieldState = . error( message: " 최대 10자까지 입력 가능합니다. " )
202220 return . none
203221 }
204- /// [3 ]. 닉네임에 특수문자가 포함되어 있을 때
222+ /// [5 ]. 닉네임에 특수문자가 포함되어 있을 때
205223 if !state. text. isNickNameValid {
206224 state. buttonState = . disable
207225 state. textfieldState = . error( message: " 한글, 영어, 숫자만 입력이 가능합니다. " )
208226 return . none
209- } else {
210- /// [4]. 정상 케이스일 때
211- return . run { send in await send ( . async( . 닉네임_중복_확인_API) ) }
212227 }
228+ /// [6]. 정상 케이스일 때
229+ return . run { send in await send ( . async( . 닉네임_중복_확인_API) ) }
213230
214231 case let . 닉네임_중복_확인_API_반영( isDuplicate) :
215232 state. textfieldState = isDuplicate
@@ -254,7 +271,7 @@ private extension NickNameSettingFeature {
254271
255272 case . 프로필_목록_조회_API:
256273 return . run { send in
257- let response = try await categoryClient . 카테고리_프로필_목록_조회 ( )
274+ let response = try await userClient . 프로필_이미지_목록_조회 ( )
258275 let images = response. map { $0. toDomain ( ) }
259276 await send ( . inner( . 프로필_목록_조회_API_반영( images: images) ) )
260277 }
0 commit comments