Quote Toot rendering fixes
This commit is contained in:
parent
aff318b0ca
commit
7ac8333912
|
@ -183,6 +183,7 @@ public struct StatusMediaPreviewView: View {
|
|||
case .gifv, .video, .audio:
|
||||
if let url = attachment.url {
|
||||
VideoPlayerView(viewModel: .init(url: url))
|
||||
.frame(maxWidth: isNotifications ? imageMaxHeight : nil)
|
||||
.frame(height: imageMaxHeight)
|
||||
}
|
||||
case .none:
|
||||
|
|
|
@ -368,7 +368,7 @@ public struct StatusRowView: View {
|
|||
@ViewBuilder
|
||||
private func makeCardView(status: AnyStatus) -> some View {
|
||||
if let card = status.card,
|
||||
viewModel.embeddedStatus?.url != status.card?.url,
|
||||
status.content.statusesURLs.isEmpty,
|
||||
status.mediaAttachments.isEmpty,
|
||||
!viewModel.isEmbedLoading,
|
||||
theme.statusDisplayStyle == .large
|
||||
|
@ -384,6 +384,7 @@ public struct StatusRowView: View {
|
|||
let embed = viewModel.embeddedStatus
|
||||
{
|
||||
StatusEmbeddedView(status: embed)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
} else if viewModel.isEmbedLoading, !viewModel.isCompact {
|
||||
StatusEmbeddedView(status: .placeholder())
|
||||
.redacted(reason: .placeholder)
|
||||
|
|
|
@ -20,7 +20,7 @@ public class StatusRowViewModel: ObservableObject {
|
|||
@Published var repliesCount: Int
|
||||
@Published var embeddedStatus: Status?
|
||||
@Published var displaySpoiler: Bool = false
|
||||
@Published var isEmbedLoading: Bool = true
|
||||
@Published var isEmbedLoading: Bool = false
|
||||
@Published var isFiltered: Bool = false
|
||||
|
||||
@Published var translation: String?
|
||||
|
@ -73,6 +73,7 @@ public class StatusRowViewModel: ObservableObject {
|
|||
|
||||
func loadEmbeddedStatus() async {
|
||||
guard let client,
|
||||
embeddedStatus == nil,
|
||||
!status.content.statusesURLs.isEmpty,
|
||||
let url = status.content.statusesURLs.first,
|
||||
client.hasConnection(with: url)
|
||||
|
@ -81,9 +82,7 @@ public class StatusRowViewModel: ObservableObject {
|
|||
return
|
||||
}
|
||||
do {
|
||||
withAnimation {
|
||||
isEmbedLoading = true
|
||||
}
|
||||
isEmbedLoading = true
|
||||
var embed: Status?
|
||||
if url.absoluteString.contains(client.server), let id = Int(url.lastPathComponent) {
|
||||
embed = try await client.get(endpoint: Statuses.status(id: String(id)))
|
||||
|
|
Loading…
Reference in New Issue