1
0
mirror of https://github.com/yattee/yattee.git synced 2025-04-28 07:50:33 +05:30

no preview shows nothing now

This commit is contained in:
Toni Förster 2023-11-25 21:48:22 +01:00
parent cbdf295d67
commit ed5fa8e4aa
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7

View File

@ -23,21 +23,24 @@ struct VideoDescription: View {
descriptionView.id(video.videoID) descriptionView.id(video.videoID)
} }
var descriptionView: some View { @ViewBuilder var descriptionView: some View {
VStack { if !expand && collapsedLinesDescription == 0 {
#if os(iOS) EmptyView()
ActiveLabelDescriptionRepresentable( } else {
description: description, VStack {
detailsSize: detailsSize, #if os(iOS)
expand: shouldExpand ActiveLabelDescriptionRepresentable(
) description: description,
#else detailsSize: detailsSize,
textDescription expand: expand
#endif )
#else
textDescription
#endif
keywords keywords
}.contentShape(Rectangle())
} }
.contentShape(Rectangle())
} }
var shouldExpand: Bool { var shouldExpand: Bool {
@ -176,7 +179,12 @@ struct VideoDescription: View {
} }
func updateNumberOfLines() { func updateNumberOfLines() {
label.numberOfLines = expand ? 0 : collapsedLinesDescription if expand || collapsedLinesDescription > 0 {
label.numberOfLines = expand ? 0 : collapsedLinesDescription
label.isHidden = false
} else {
label.isHidden = true
}
} }
func urlTapHandler(_ url: URL) { func urlTapHandler(_ url: URL) {