From 78eee1e855168eed9068da61f2617da94733a234 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sun, 21 Jan 2024 18:49:45 +0100 Subject: [PATCH] Fix status embed --- .../Row/Subviews/StatusRowContentView.swift | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowContentView.swift b/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowContentView.swift index 0e96c9b8..fdee4297 100644 --- a/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowContentView.swift +++ b/Packages/StatusKit/Sources/StatusKit/Row/Subviews/StatusRowContentView.swift @@ -31,12 +31,20 @@ struct StatusRowContentView: View { !isCompact, viewModel.isEmbedLoading || viewModel.embeddedStatus != nil { - StatusEmbeddedView(status: viewModel.embeddedStatus ?? Status.placeholder(), - client: viewModel.client, - routerPath: viewModel.routerPath) - .fixedSize(horizontal: false, vertical: true) - .redacted(reason: viewModel.isEmbedLoading ? .placeholder : []) - .transition(.opacity) + if let embeddedStatus = viewModel.embeddedStatus { + StatusEmbeddedView(status: embeddedStatus, + client: viewModel.client, + routerPath: viewModel.routerPath) + .fixedSize(horizontal: false, vertical: true) + .transition(.opacity) + } else { + StatusEmbeddedView(status: Status.placeholder(), + client: viewModel.client, + routerPath: viewModel.routerPath) + .fixedSize(horizontal: false, vertical: true) + .redacted(reason: .placeholder) + .transition(.opacity) + } } if !viewModel.finalStatus.mediaAttachments.isEmpty {