added alert to show possible error, improved tests

This commit is contained in:
Flavio Alescio
2023-01-27 17:10:16 +01:00
parent 378d4d072e
commit 9d0f5c208b
7 changed files with 45 additions and 40 deletions
@@ -64,10 +64,11 @@ struct PollHistory: View {
ScrollView {
LazyVStack(spacing: 32) {
ForEach(viewModel.viewState.polls ?? []) { pollData in
PollListItem(pollData: pollData)
.onTapGesture {
viewModel.send(viewAction: .showPollDetail(poll: pollData))
}
Button(action: {
viewModel.send(viewAction: .showPollDetail(poll: pollData))
}) {
PollListItem(pollData: pollData)
}
}
.frame(maxWidth: .infinity, alignment: .leading)