Skip to content

Commit

Permalink
✅ Chore: 커뮤니티 작성뷰에서 “글을 올리시겠습니까?” 아니요 누르면 자동으로 작성중이던 화면이 닫히는 문제 해결 (#596
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hwangJi-dev committed Oct 26, 2022
1 parent abcd35d commit 9530225
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ extension WriteQuestionVC {
}

/// dismissBtn Press
questionWriteNaviBar.dismissBtn.press {
questionWriteNaviBar.dismissBtn.press { [weak self] in
guard let self = self else { return }

guard let alert = Bundle.main.loadNibNamed(NadoAlertVC.className, owner: self, options: nil)?.first as? NadoAlertVC else { return }
alert.showNadoAlert(vc: self, message: self.dismissAlertMsg, confirmBtnTitle: "계속 작성", cancelBtnTitle: "나갈래요")
alert.showNadoAlert(vc: self, message: self.dismissAlertMsg, confirmBtnTitle: self.isEditState ? "계속 수정" : "계속 작성", cancelBtnTitle: "나갈래요")
alert.cancelBtn.press {
self.dismiss(animated: true, completion: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,25 +169,30 @@ extension CommunityWriteVC {
.disposed(by: disposeBag)

questionWriteNaviBar.rightActivateBtn.rx.tap
.subscribe(onNext: {
self.nadoAlert?.showNadoAlert(vc: self, message: self.confirmAlertMsg, confirmBtnTitle: "", cancelBtnTitle: "아니요")
.subscribe(onNext: { [weak self] in
guard let self = self else { return }

guard let alert = Bundle.main.loadNibNamed(NadoAlertVC.className, owner: self, options: nil)?.first as? NadoAlertVC else { return }
alert.showNadoAlert(vc: self, message: self.confirmAlertMsg, confirmBtnTitle: "", cancelBtnTitle: "아니요")
alert.confirmBtn.press {
if self.isEditState {
reactor.action.onNext(.tapQuestionEditBtn(postID: self.postID ?? 0, title: self.questionTitleTextField.text ?? "", content: self.questionWriteTextView.text ?? ""))
} else {
reactor.action.onNext(.tapQuestionWriteBtn(type: self.selectedCategory, majorID: self.majorID ?? MajorIDConstants.regardlessMajorID, answererID: 0, title: self.questionTitleTextField.text ?? "", content: self.questionWriteTextView.text))
}
}
})
.disposed(by: disposeBag)

nadoAlert?.confirmBtn.rx.tap.map{
if self.isEditState {
return CommunityWriteReactor.Action.tapQuestionEditBtn(postID: self.postID ?? 0, title: self.questionTitleTextField.text ?? "", content: self.questionWriteTextView.text ??
"")
} else {
return CommunityWriteReactor.Action.tapQuestionWriteBtn(type: self.selectedCategory, majorID: self.majorID ?? MajorIDConstants.regardlessMajorID, answererID: 0, title: self.questionTitleTextField.text ?? "", content: self.questionWriteTextView.text)
}
}
.bind(to: reactor.action)
.disposed(by: disposeBag)

questionWriteNaviBar.dismissBtn.rx.tap
.subscribe(onNext: {
self.nadoAlert?.showNadoAlert(vc: self, message: self.dismissAlertMsg, confirmBtnTitle: "계속 작성", cancelBtnTitle: "나갈래요")
.subscribe(onNext: { [weak self] in
guard let self = self else { return }

guard let alert = Bundle.main.loadNibNamed(NadoAlertVC.className, owner: self, options: nil)?.first as? NadoAlertVC else { return }
alert.showNadoAlert(vc: self, message: self.dismissAlertMsg, confirmBtnTitle: self.isEditState ? "계속 수정" : "계속 작성", cancelBtnTitle: "나갈래요")
alert.cancelBtn.press {
self.dismiss(animated: true, completion: nil)
}
})
.disposed(by: disposeBag)

Expand Down

0 comments on commit 9530225

Please sign in to comment.