commit 69f8bc9779e3b8919b0ae4eb77300cb02a849f13
parent 65d7bbf050136412a1f395de9a7d01b0a1f5b3c4
Author: William Casarin <jb55@jb55.com>
Date: Wed, 28 Dec 2022 22:38:55 -0800
Disable link previews for iOS <16
Changelog-Fixed: Disabled link previews for iOS 15.* to fix crashing
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift
@@ -131,12 +131,19 @@ struct NoteContentView: View {
}
.task {
if show_images, artifacts.links.count == 1 {
+
self.metaData = await getMetaData(for: artifacts.links.first!)
}
}
}
+
func getMetaData(for url: URL) async -> LPLinkMetadata? {
+ // iOS 15 is crashing for some reason
+ guard #available(iOS 16, *) else {
+ return nil
+ }
+
let provider = LPMetadataProvider()
do {