Skip to content

Commit e408d73

Browse files
authored
Merge pull request #188 from akaktus/Cancel-boarding
Cancel boarding
2 parents ae79ca9 + 769c491 commit e408d73

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

o-fish-ios/Views/ReportFlow/ReportNavigationRootView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct ReportNavigationRootView: View {
3838
.background(Color.backgroundGrey)
3939
.navigationBarBackButtonHidden(true)
4040
.navigationBarItems(
41-
leading: Button(action: discardReport) {
41+
leading: Button(action: showCancelAlert) {
4242
Text("Cancel")
4343
}, trailing: Button(action: submitNavBarClicked) {
4444
Text("Submit")
@@ -65,6 +65,13 @@ struct ReportNavigationRootView: View {
6565
secondaryButton: .cancel(Text("Submit"), action: saveAlertClicked))
6666
}
6767

68+
private func showCancelAlert() {
69+
showingAlertItem = AlertItem(title: NSLocalizedString("Cancel boarding?", comment: ""),
70+
message: "This boarding will not be saved.",
71+
primaryButton: .default(Text("Keep Editing")),
72+
secondaryButton: .cancel(Text("Cancel"), action: discardReport))
73+
}
74+
6875
private func showFinalAlert() {
6976
if notFilledScreens.isEmpty {
7077
showSubmitAlert()

0 commit comments

Comments
 (0)