Jul 13 - Update codes to catch up with the web app updates: scheduled inspection and issue's handler
This commit is contained in:
@@ -22,6 +22,13 @@ struct ExecuteInspectionView: View {
|
||||
|
||||
let inspection: LocalInspection
|
||||
|
||||
/// True when presented as the root of a fullScreenCover/sheet (e.g. the
|
||||
/// dashboard "Resume" banner) rather than pushed onto a NavigationStack.
|
||||
/// In that case there is no navigation back button, so a leading "Close"
|
||||
/// button is shown so the inspector can return home without submitting.
|
||||
/// Work is preserved either way — .onDisappear calls saveDraft().
|
||||
var isModallyPresented: Bool = false
|
||||
|
||||
@State private var formValues: [String: String] = [:]
|
||||
@State private var showFlagIssue = false
|
||||
@State private var showSubmitAlert = false
|
||||
@@ -120,6 +127,13 @@ struct ExecuteInspectionView: View {
|
||||
.navigationTitle(template?.name ?? "Inspection")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
if isModallyPresented {
|
||||
ToolbarItem(placement: .topBarLeading) {
|
||||
// Root of a modal presentation — no nav back button exists.
|
||||
// Draft is saved on disappear, so closing loses nothing.
|
||||
Button("Close") { dismiss() }
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
HStack(spacing: 10) {
|
||||
// Live score — updates on every field change via formValues binding.
|
||||
|
||||
Reference in New Issue
Block a user