Skip to content

Commit e97f167

Browse files
committed
Remove unneeded Boolean.
#657 (comment)
1 parent 13ce56e commit e97f167

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Shared/Samples/Edit features using feature forms/EditFeaturesUsingFeatureFormsView.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ struct EditFeaturesUsingFeatureFormsView: View {
3737
/// A Boolean value indicating whether the discard edits alert is presented.
3838
@State private var isShowingDiscardEditsAlert = false
3939

40-
/// A Boolean value indicating whether the feature form has any validation errors.
41-
@State private var hasValidationErrors = false
42-
4340
/// A Boolean value indicating whether the feature form edits are being applied.
4441
@State private var isApplyingEdits = false
4542

@@ -50,8 +47,6 @@ struct EditFeaturesUsingFeatureFormsView: View {
5047
private var instructionText: String {
5148
if !isShowingFeatureForm {
5249
"Tap on a feature to edit."
53-
} else if hasValidationErrors {
54-
"Fix the errors to apply the edits."
5550
} else if isApplyingEdits {
5651
"Applying edits..."
5752
} else {
@@ -118,13 +113,6 @@ struct EditFeaturesUsingFeatureFormsView: View {
118113
fatalError("Unknown form editing event: \(event)")
119114
}
120115
}
121-
.task {
122-
defer { hasValidationErrors = false }
123-
124-
for await validationErrors in featureForm.$validationErrors {
125-
hasValidationErrors = !validationErrors.isEmpty
126-
}
127-
}
128116
.task(id: isApplyingEdits) {
129117
guard isApplyingEdits else { return }
130118
defer { isApplyingEdits = false }

0 commit comments

Comments
 (0)