mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-19 19:16:16 +00:00
Restore / Fix embed status view
This commit is contained in:
parent
987f259130
commit
2df40ff543
1 changed files with 26 additions and 8 deletions
|
@ -57,6 +57,7 @@ public struct StatusRowView: View {
|
|||
}
|
||||
}
|
||||
.onAppear {
|
||||
if reasons.isEmpty {
|
||||
viewModel.client = client
|
||||
if !viewModel.isCompact, viewModel.embeddedStatus == nil {
|
||||
Task {
|
||||
|
@ -67,6 +68,7 @@ public struct StatusRowView: View {
|
|||
viewModel.displaySpoiler = false
|
||||
}
|
||||
}
|
||||
}
|
||||
.contextMenu {
|
||||
StatusRowContextMenu(viewModel: viewModel)
|
||||
}
|
||||
|
@ -242,6 +244,8 @@ public struct StatusRowView: View {
|
|||
StatusPollView(poll: poll, status: status)
|
||||
}
|
||||
|
||||
embedStatusView
|
||||
|
||||
makeMediasView(status: status)
|
||||
.accessibilityHidden(!viewModel.isFocused)
|
||||
makeCardView(status: status)
|
||||
|
@ -350,4 +354,18 @@ public struct StatusRowView: View {
|
|||
StatusCardView(card: card)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var embedStatusView: some View {
|
||||
if !reasons.contains(.placeholder) {
|
||||
if !viewModel.isCompact, !viewModel.isEmbedLoading,
|
||||
let embed = viewModel.embeddedStatus {
|
||||
StatusEmbeddedView(status: embed)
|
||||
} else if viewModel.isEmbedLoading, !viewModel.isCompact {
|
||||
StatusEmbeddedView(status: .placeholder())
|
||||
.redacted(reason: .placeholder)
|
||||
.shimmering()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue