mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 17:42:45 +02:00
Fix: allow to render a TimelinePoll even if the poll is loading
This commit is contained in:
@@ -28,6 +28,23 @@ struct TimelinePollView: View {
|
||||
@ObservedObject var viewModel: TimelinePollViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
switch viewModel.pollState {
|
||||
case .loading:
|
||||
TimelinePollMessageView(message: "loading...")
|
||||
case .loaded:
|
||||
pollContent
|
||||
case .invalidStartEvent:
|
||||
TimelinePollMessageView(message: VectorL10n.pollTimelineReplyEndedPoll)
|
||||
}
|
||||
}
|
||||
.alert(item: $viewModel.alertInfo) { info in
|
||||
info.alert
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var pollContent: some View {
|
||||
let poll = viewModel.viewState.poll
|
||||
|
||||
VStack(alignment: .leading, spacing: 16.0) {
|
||||
@@ -61,9 +78,6 @@ struct TimelinePollView: View {
|
||||
}
|
||||
.padding([.horizontal, .top], 2.0)
|
||||
.padding([.bottom])
|
||||
.alert(item: $viewModel.alertInfo) { info in
|
||||
info.alert
|
||||
}
|
||||
}
|
||||
|
||||
private var totalVotesString: String {
|
||||
|
||||
Reference in New Issue
Block a user