mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-18 19:56:27 +00:00
Linter fixes
This commit is contained in:
parent
43a3415e80
commit
915973ffe1
4 changed files with 23 additions and 15 deletions
|
@ -116,8 +116,8 @@ private extension CompositionPollView {
|
||||||
|
|
||||||
addChoiceButton.isEnabled = $0.count < CompositionViewModel.maxPollOptionCount
|
addChoiceButton.isEnabled = $0.count < CompositionViewModel.maxPollOptionCount
|
||||||
|
|
||||||
for (index, option) in $0.enumerated() {
|
for (index, option) in $0.enumerated()
|
||||||
if !self.pollOptionViews.contains(where: { $0.option === option }) {
|
where !self.pollOptionViews.contains(where: { $0.option === option }) {
|
||||||
let optionView = CompositionPollOptionView(
|
let optionView = CompositionPollOptionView(
|
||||||
viewModel: self.viewModel,
|
viewModel: self.viewModel,
|
||||||
parentViewModel: self.parentViewModel,
|
parentViewModel: self.parentViewModel,
|
||||||
|
@ -128,7 +128,6 @@ private extension CompositionPollView {
|
||||||
index + 1)
|
index + 1)
|
||||||
self.stackView.insertArrangedSubview(optionView, at: index)
|
self.stackView.insertArrangedSubview(optionView, at: index)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (index, optionView) in self.pollOptionViews.enumerated() {
|
for (index, optionView) in self.pollOptionViews.enumerated() {
|
||||||
optionView.removeButton.isHidden_stackViewSafe = index < CompositionViewModel.minPollOptionCount
|
optionView.removeButton.isHidden_stackViewSafe = index < CompositionViewModel.minPollOptionCount
|
||||||
|
|
|
@ -156,7 +156,12 @@ private extension LoadMoreView {
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
|
|
||||||
self.label.isHidden = $0
|
self.label.isHidden = $0
|
||||||
$0 ? self.activityIndicatorView.startAnimating() : self.activityIndicatorView.stopAnimating()
|
|
||||||
|
if $0 {
|
||||||
|
self.activityIndicatorView.startAnimating()
|
||||||
|
} else {
|
||||||
|
self.activityIndicatorView.stopAnimating()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,8 +183,12 @@ extension PollView {
|
||||||
let open = !poll.expired && !poll.voted
|
let open = !poll.expired && !poll.voted
|
||||||
|
|
||||||
for option in poll.options {
|
for option in poll.options {
|
||||||
height += open ? PollOptionButton.estimatedHeight(width: width, title: option.title)
|
if open {
|
||||||
: PollResultView.estimatedHeight(width: width, title: option.title)
|
height += PollOptionButton.estimatedHeight(width: width, title: option.title)
|
||||||
|
} else {
|
||||||
|
height += PollResultView.estimatedHeight(width: width, title: option.title)
|
||||||
|
}
|
||||||
|
|
||||||
height += .defaultSpacing
|
height += .defaultSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue