mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Disable load more button if needed
This commit is contained in:
@@ -73,19 +73,22 @@ struct PollHistory: View {
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var loadMoreButton: some View {
|
||||
HStack(spacing: 8) {
|
||||
if viewModel.viewState.isLoading {
|
||||
spinner
|
||||
if viewModel.viewState.canLoadMoreContent {
|
||||
HStack(spacing: 8) {
|
||||
if viewModel.viewState.isLoading {
|
||||
spinner
|
||||
}
|
||||
|
||||
Button {
|
||||
viewModel.send(viewAction: .loadMoreContent)
|
||||
} label: {
|
||||
Text(VectorL10n.pollHistoryLoadMore)
|
||||
.font(theme.fonts.body)
|
||||
}
|
||||
.disabled(viewModel.viewState.isLoading)
|
||||
}
|
||||
|
||||
Button {
|
||||
viewModel.send(viewAction: .loadMoreContent)
|
||||
} label: {
|
||||
Text(VectorL10n.pollHistoryLoadMore)
|
||||
.font(theme.fonts.body)
|
||||
}
|
||||
.disabled(viewModel.viewState.isLoading || !viewModel.viewState.canLoadMoreContent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user