Allow videos in posts, simplify post image view
This commit is contained in:
@@ -53,6 +53,16 @@ final class LocalizedPost: ObservableObject {
|
||||
}
|
||||
linkPreview.remove(file)
|
||||
}
|
||||
|
||||
// MARK: Images
|
||||
|
||||
var hasImages: Bool {
|
||||
images.contains { $0.type.isImage }
|
||||
}
|
||||
|
||||
var hasVideos: Bool {
|
||||
images.contains { $0.type.isVideo }
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Storage
|
||||
@@ -65,7 +75,7 @@ extension LocalizedPost {
|
||||
title: data.title,
|
||||
text: data.text,
|
||||
lastModified: data.lastModifiedDate,
|
||||
images: data.images.compactMap(context.image),
|
||||
images: data.images.compactMap(context.postMedia),
|
||||
pageLinkText: data.pageLinkText,
|
||||
linkPreview: .init(context: context, data: data.linkPreview))
|
||||
}
|
||||
|
Reference in New Issue
Block a user