diff --git a/KkuMulKum/Source/Promise/PagePromise/ViewController/PromiseViewController.swift b/KkuMulKum/Source/Promise/PagePromise/ViewController/PromiseViewController.swift index c0ccbaf..41dd5ea 100644 --- a/KkuMulKum/Source/Promise/PagePromise/ViewController/PromiseViewController.swift +++ b/KkuMulKum/Source/Promise/PagePromise/ViewController/PromiseViewController.swift @@ -184,6 +184,14 @@ private extension PromiseViewController { toast.show(message: message, view: owner.view, position: .bottom, inset: 100) } + + viewModel.isExitSuccess.bindOnMain(with: self) { owner, isSuccess in + owner.navigationController?.popViewController(animated: true) + } + + viewModel.isDeleteSuccess.bindOnMain(with: self) { owner, isSuccess in + owner.navigationController?.popViewController(animated: true) + } } @objc @@ -226,9 +234,13 @@ private extension PromiseViewController { extension PromiseViewController: CustomActionSheetDelegate { func actionButtonDidTap(for kind: ActionSheetKind) { if kind == .deletePromise { + viewModel.deletePromise() + dismiss(animated: false) } else { + viewModel.exitPromise() + dismiss(animated: false) } } diff --git a/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift b/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift index ae05f9b..61c2e4f 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/ViewController/ReadyStatusViewController.swift @@ -116,6 +116,7 @@ extension ReadyStatusViewController { $0.enterReadyButtonView.isHidden = owner.viewModel.isReadyInfoEntered() $0.readyPlanInfoView.isHidden = !$0.enterReadyButtonView.isHidden $0.enterReadyButtonView.isUserInteractionEnabled = isParticipant + $0.myReadyStatusProgressView.isUserInteractionEnabled = isParticipant } } diff --git a/KkuMulKum/Source/Promise/ViewModel/PromiseViewModel.swift b/KkuMulKum/Source/Promise/ViewModel/PromiseViewModel.swift index f8fec74..06243ea 100644 --- a/KkuMulKum/Source/Promise/ViewModel/PromiseViewModel.swift +++ b/KkuMulKum/Source/Promise/ViewModel/PromiseViewModel.swift @@ -30,6 +30,8 @@ class PromiseViewModel { let participantList = ObservablePattern<[Participant]>([]) let tardyList = ObservablePattern<[Comer]>([]) let isFinishSuccess = ObservablePattern(nil) + let isDeleteSuccess = ObservablePattern(nil) + let isExitSuccess = ObservablePattern(nil) let errorMessage = ObservablePattern(nil) var pageControlDirection = false @@ -359,6 +361,8 @@ extension PromiseViewModel { print(">>>>> \(String(describing: result)) : \(#function)") return } + + isDeleteSuccess.value = success } catch { print(">>>>> \(error.localizedDescription) : \(#function)") } @@ -377,6 +381,8 @@ extension PromiseViewModel { print(">>>>> \(String(describing: result)) : \(#function)") return } + + isExitSuccess.value = success } catch { print(">>>>> \(error.localizedDescription) : \(#function)") }