From b0bdaac8b45c7740431f92ce03f4bd3497a6c05b Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Fri, 8 Dec 2023 14:29:01 +0100 Subject: [PATCH] Fix CW layout issues (IOS-207) --- .../View/Content/StatusView+Configuration.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift index cf3061c49..24cf83f70 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/StatusView+Configuration.swift @@ -150,8 +150,12 @@ extension StatusView { if let inReplyToID = status.entity.inReplyToID { // A. replyTo status exist + + /// we need to initially set an empty header, otherwise the layout gets messed up + viewModel.header = createHeader(name: "", emojis: [:]) + /// finally we can load the status information and display the correct header if let authenticationBox = viewModel.authContext?.mastodonAuthenticationBox { - Task { + Task { @MainActor in if let replyTo = try? await Mastodon.API.Statuses.status( session: .shared, domain: authenticationBox.domain, @@ -198,7 +202,7 @@ extension StatusView { } public func configureAuthor(author: Mastodon.Entity.Account) { - Task { + Task { @MainActor in // author avatar viewModel.authorAvatarImageURL = author.avatarImageURL()