From 39dc6dadc7928817ad7c378703f78ca483301f95 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Mon, 9 Jan 2023 20:51:12 +0100 Subject: [PATCH] Support server side auto expand spoiler --- Packages/Status/Sources/Status/Row/StatusRowView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Packages/Status/Sources/Status/Row/StatusRowView.swift b/Packages/Status/Sources/Status/Row/StatusRowView.swift index 499100fb..34f6c868 100644 --- a/Packages/Status/Sources/Status/Row/StatusRowView.swift +++ b/Packages/Status/Sources/Status/Row/StatusRowView.swift @@ -7,6 +7,7 @@ import Shimmer public struct StatusRowView: View { @Environment(\.redactionReasons) private var reasons + @EnvironmentObject private var preferences: UserPreferences @EnvironmentObject private var account: CurrentAccount @EnvironmentObject private var theme: Theme @EnvironmentObject private var client: Client @@ -60,6 +61,9 @@ public struct StatusRowView: View { await viewModel.loadEmbededStatus() } } + if preferences.serverPreferences?.autoExpandSpoilers == true { + viewModel.displaySpoiler = false + } } .contextMenu { StatusRowContextMenu(viewModel: viewModel)