summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-22 06:52:14 -0800
committerFuwn <[email protected]>2025-02-22 06:52:14 -0800
commitb2acdb1c989ccf07a41c34848f47bc491fec2ecc (patch)
tree77e0613fa19e58150ee5709369536219be2a045b /Sora
parentfeat: Development commit (diff)
downloadsora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.tar.xz
sora-testing-b2acdb1c989ccf07a41c34848f47bc491fec2ecc.zip
feat: Development commit
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Other/AsyncImageWithPreview.swift24
1 files changed, 13 insertions, 11 deletions
diff --git a/Sora/Other/AsyncImageWithPreview.swift b/Sora/Other/AsyncImageWithPreview.swift
index 488e66e..56af307 100644
--- a/Sora/Other/AsyncImageWithPreview.swift
+++ b/Sora/Other/AsyncImageWithPreview.swift
@@ -12,18 +12,20 @@ struct AsyncImageWithPreview<Placeholder: View>: View {
@State private var currentOffset: CGSize = .zero
@State private var finalOffset: CGSize = .zero
- var keyWindow: UIWindow? {
- guard
- let window = UIApplication.shared.connectedScenes
- .compactMap({ $0 as? UIWindowScene })
- .flatMap(\.windows)
- .first(where: \.isKeyWindow)
- else {
- return nil
- }
+ #if os(iOS)
+ var keyWindow: UIWindow? {
+ guard
+ let window = UIApplication.shared.connectedScenes
+ .compactMap({ $0 as? UIWindowScene })
+ .flatMap(\.windows)
+ .first(where: \.isKeyWindow)
+ else {
+ return nil
+ }
- return window
- }
+ return window
+ }
+ #endif
var body: some View {
AsyncImage(url: url) { image in