From 2974da7a529cefcedc68462ec4d06fdba15ad4c7 Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Sun, 10 Sep 2023 12:42:11 -0400 Subject: [PATCH] Fix iPad share (#579) --- Mlem/Views/Shared/Posts/Expanded Post.swift | 3 --- Mlem/Views/Tabs/Feeds/Feed View.swift | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Mlem/Views/Shared/Posts/Expanded Post.swift b/Mlem/Views/Shared/Posts/Expanded Post.swift index 59ac7b6e1..a29c5c90b 100644 --- a/Mlem/Views/Shared/Posts/Expanded Post.swift +++ b/Mlem/Views/Shared/Posts/Expanded Post.swift @@ -24,7 +24,6 @@ private struct AnchorsKey: PreferenceKey { } } -// swiftlint:disable type_body_length struct ExpandedPost: View { @Dependency(\.apiClient) var apiClient @Dependency(\.commentRepository) var commentRepository @@ -327,5 +326,3 @@ struct ExpandedPost: View { } } } - -// swiftlint:enable type_body_length diff --git a/Mlem/Views/Tabs/Feeds/Feed View.swift b/Mlem/Views/Tabs/Feeds/Feed View.swift index ca0536066..6a5a653da 100644 --- a/Mlem/Views/Tabs/Feeds/Feed View.swift +++ b/Mlem/Views/Tabs/Feeds/Feed View.swift @@ -96,6 +96,16 @@ struct FeedView: View { @Environment(\.horizontalSizeClass) private var horizontalSizeClass + // MARK: Destructive confirmation + + @State private var isPresentingConfirmDestructive: Bool = false + @State private var confirmationMenuFunction: StandardMenuFunction? + + func confirmDestructive(destructiveFunction: StandardMenuFunction) { + confirmationMenuFunction = destructiveFunction + isPresentingConfirmDestructive = true + } + // MARK: - Main Views var body: some View {