Support server side auto expand spoiler

This commit is contained in:
Thomas Ricouard 2023-01-09 20:51:12 +01:00
parent 2961793e87
commit 39dc6dadc7

View file

@ -7,6 +7,7 @@ import Shimmer
public struct StatusRowView: View { public struct StatusRowView: View {
@Environment(\.redactionReasons) private var reasons @Environment(\.redactionReasons) private var reasons
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var account: CurrentAccount @EnvironmentObject private var account: CurrentAccount
@EnvironmentObject private var theme: Theme @EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client @EnvironmentObject private var client: Client
@ -60,6 +61,9 @@ public struct StatusRowView: View {
await viewModel.loadEmbededStatus() await viewModel.loadEmbededStatus()
} }
} }
if preferences.serverPreferences?.autoExpandSpoilers == true {
viewModel.displaySpoiler = false
}
} }
.contextMenu { .contextMenu {
StatusRowContextMenu(viewModel: viewModel) StatusRowContextMenu(viewModel: viewModel)