Browse Source

Disable link previews for iOS <16

Changelog-Fixed: Disabled link previews for iOS 15.* to fix crashing
post-button-style
William Casarin 2 years ago
parent
commit
69f8bc9779
  1. 7
      damus/Views/NoteContentView.swift

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

Loading…
Cancel
Save