Disable link previews for iOS <16

Changelog-Fixed: Disabled link previews for iOS 15.* to fix crashing
This commit is contained in:
William Casarin
2022-12-28 22:38:55 -08:00
parent 65d7bbf050
commit 69f8bc9779

View File

@@ -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 {