summaryrefslogtreecommitdiff
path: root/Sora/Other/AsyncImageWithPreview.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-22 06:40:27 -0800
committerFuwn <[email protected]>2025-02-22 06:40:27 -0800
commit97b0b0f5dd54cab5e9dd78ac930306e66e4edcfe (patch)
tree7e9022322908e3e42646e5da773fe0f0dad1790d /Sora/Other/AsyncImageWithPreview.swift
parentfeat: Development commit (diff)
downloadsora-testing-97b0b0f5dd54cab5e9dd78ac930306e66e4edcfe.tar.xz
sora-testing-97b0b0f5dd54cab5e9dd78ac930306e66e4edcfe.zip
feat: Development commit
Diffstat (limited to 'Sora/Other/AsyncImageWithPreview.swift')
-rw-r--r--Sora/Other/AsyncImageWithPreview.swift21
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