diff options
Diffstat (limited to 'Sora/Other/AsyncImageWithPreview.swift')
| -rw-r--r-- | Sora/Other/AsyncImageWithPreview.swift | 21 |
1 files changed, 12 insertions, 9 deletions
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<Placeholder: View>: View { + @EnvironmentObject var settings: Settings var url: URL? @Binding var loadingState: PostLoadingState var finalLoadingState: PostLoadingState @@ -34,16 +35,18 @@ struct AsyncImageWithPreview<Placeholder: View>: 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 |