From 9ce3fdd6a09d56ceae142dfce507b7859b0bb620 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Mon, 9 Dec 2024 21:11:00 +0100 Subject: [PATCH 1/2] AccountOverviewForm: take `closeBehavior` into account --- .../AccountOverview/AccountOverviewForm.swift | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift b/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift index cbc8aed..f42084b 100644 --- a/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift +++ b/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift @@ -68,16 +68,21 @@ struct AccountOverviewForm: View { if !isProcessing { ToolbarItem(placement: .cancellationAction) { if editMode?.wrappedValue.isEditing == true { - Button(action: { + Button { model.cancelEditAction(editMode: editMode) - }) { + } label: { Text("CANCEL", bundle: .module) } } else { - Button(action: { - dismiss() - }) { - Text("CLOSE", bundle: .module) + switch closeBehavior { + case .disabled: + let _ = () + case .showCloseButton: + Button { + dismiss() + } label: { + Text("CLOSE", bundle: .module) + } } } } From 3a84cfd3031e02ea8adf1b73c25fa98e98608e22 Mon Sep 17 00:00:00 2001 From: Lukas Kollmer Date: Mon, 9 Dec 2024 21:19:15 +0100 Subject: [PATCH 2/2] swiftlint? --- .../Views/AccountOverview/AccountOverviewForm.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift b/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift index f42084b..5919d6c 100644 --- a/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift +++ b/Sources/SpeziAccount/Views/AccountOverview/AccountOverviewForm.swift @@ -76,7 +76,7 @@ struct AccountOverviewForm: View { } else { switch closeBehavior { case .disabled: - let _ = () + EmptyView() case .showCloseButton: Button { dismiss()