From 97b0b0f5dd54cab5e9dd78ac930306e66e4edcfe Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 22 Feb 2025 06:40:27 -0800 Subject: feat: Development commit --- Sora/Other/AsyncImageWithPreview.swift | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'Sora/Other') diff --git a/Sora/Other/AsyncImageWithPreview.swift b/Sora/Other/AsyncImageWithPreview.swift index 9cae976..6c47fb9 100644 --- a/Sora/Other/AsyncImageWithPreview.swift +++ b/Sora/Other/AsyncImageWithPreview.swift @@ -1,6 +1,7 @@ import SwiftUI struct AsyncImageWithPreview: View { + @EnvironmentObject var settings: Settings var url: URL? @Binding var loadingState: PostLoadingState var finalLoadingState: PostLoadingState @@ -34,16 +35,18 @@ struct AsyncImageWithPreview: View { #endif #if os(iOS) - Button { - let activityViewController = UIActivityViewController( - activityItems: [url ?? URL(string: "")!], applicationActivities: nil - ) + if settings.enableShareShortcut { + Button { + let activityViewController = UIActivityViewController( + activityItems: [url ?? URL(string: "")!], applicationActivities: nil + ) - UIApplication.shared.windows.first?.rootViewController?.present( - activityViewController, animated: true - ) - } label: { - Label("Share Image", systemImage: "square.and.arrow.up") + UIApplication.shared.windows.first?.rootViewController?.present( + activityViewController, animated: true + ) + } label: { + Label("Share Image", systemImage: "square.and.arrow.up") + } } #endif -- cgit v1.2.3