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