Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
refactor: 임시 비밀번호 유효하지 않은 입력값을 받는 경우 toast message로 개선 #82
Browse files Browse the repository at this point in the history
  • Loading branch information
llghdud921 committed Jul 25, 2022
1 parent be4528e commit 86b30be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class PasswordFindCoordinator: Coordinator {
authPopupCoordinator.start()
}

func showToastMessage(text: String) {
passwordFindViewController.showToast(message: text)
}

func finish() {
self.finishDelegate?.childDidFinish(self)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class PasswordFindViewModel: ViewModelType {
if isVaild {
self.issueTempPassword(email: email)
} else {
self.coordinator?.presentPopViewController(
titleText: "안내",
informText: "유효하지 않은 이메일입니다.",
dismissParentCoordinator: false)
self.coordinator?.showToastMessage(text: "이메일 형식을 맞추어주세요")
}
}).disposed(by: disposeBag)

Expand Down Expand Up @@ -86,16 +83,10 @@ extension PasswordFindViewModel {
informText: "임시비밀번호가 발급되었습니다.",
dismissParentCoordinator: true)
} else {
self.coordinator?.presentPopViewController(
titleText: "안내",
informText: "가입되지 않은 이메일입니다",
dismissParentCoordinator: false)
self.coordinator?.showToastMessage(text: "가입되지 않은 이메일입니다")
}
}, onFailure: { _ in
self.coordinator?.presentPopViewController(
titleText: "안내",
informText: "가입되지 않은 이메일입니다",
dismissParentCoordinator: false)
self.coordinator?.showToastMessage(text: "네트워크 요청에 실패하였습니다")
}, onDisposed: nil)
.disposed(by: disposeBag)
}
Expand Down

0 comments on commit 86b30be

Please sign in to comment.