Jul 27 - Update code for scheduled tasks 3
This commit is contained in:
@@ -19,6 +19,11 @@ struct MyInspectionsView: View {
|
||||
@Query(sort: \LocalScheduledInspection.dueDateString, order: .forward)
|
||||
private var scheduledAll: [LocalScheduledInspection]
|
||||
|
||||
/// Rows still awaiting action — see ScheduledInspectionsCard.visible.
|
||||
private var scheduledVisible: [LocalScheduledInspection] {
|
||||
scheduledAll.filter { !$0.fulfilledLocally }
|
||||
}
|
||||
|
||||
@Environment(\.modelContext) private var context
|
||||
|
||||
@State private var showNewInspection = false
|
||||
@@ -30,7 +35,7 @@ struct MyInspectionsView: View {
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if inspections.isEmpty && scheduledAll.isEmpty {
|
||||
if inspections.isEmpty && scheduledVisible.isEmpty {
|
||||
ContentUnavailableView(
|
||||
"No Inspections",
|
||||
systemImage: "checklist",
|
||||
@@ -39,9 +44,9 @@ struct MyInspectionsView: View {
|
||||
} else {
|
||||
List {
|
||||
// Scheduled assignments (phase36) — self-hides when empty.
|
||||
if !scheduledAll.isEmpty {
|
||||
if !scheduledVisible.isEmpty {
|
||||
Section("Scheduled") {
|
||||
ForEach(scheduledAll) { s in
|
||||
ForEach(scheduledVisible) { s in
|
||||
Button { scheduledStartTarget = ScheduledStartTarget(s) } label: {
|
||||
ScheduledRow(schedule: s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user