Linter fixes

This commit is contained in:
Justin Mazzocchi 2022-11-07 19:46:03 -08:00
parent 43a3415e80
commit 915973ffe1
4 changed files with 23 additions and 15 deletions

View file

@ -325,7 +325,7 @@ public extension ContentDatabase {
}
func createList(_ list: List) -> AnyPublisher<Never, Error> {
databaseWriter.mutatingPublisher{ try TimelineRecord(timeline: Timeline.list(list)).save($0) }
databaseWriter.mutatingPublisher { try TimelineRecord(timeline: Timeline.list(list)).save($0) }
}
func deleteList(id: List.Id) -> AnyPublisher<Never, Error> {

View file

@ -116,8 +116,8 @@ private extension CompositionPollView {
addChoiceButton.isEnabled = $0.count < CompositionViewModel.maxPollOptionCount
for (index, option) in $0.enumerated() {
if !self.pollOptionViews.contains(where: { $0.option === option }) {
for (index, option) in $0.enumerated()
where !self.pollOptionViews.contains(where: { $0.option === option }) {
let optionView = CompositionPollOptionView(
viewModel: self.viewModel,
parentViewModel: self.parentViewModel,
@ -128,7 +128,6 @@ private extension CompositionPollView {
index + 1)
self.stackView.insertArrangedSubview(optionView, at: index)
}
}
for (index, optionView) in self.pollOptionViews.enumerated() {
optionView.removeButton.isHidden_stackViewSafe = index < CompositionViewModel.minPollOptionCount

View file

@ -156,7 +156,12 @@ private extension LoadMoreView {
guard let self = self else { return }
self.label.isHidden = $0
$0 ? self.activityIndicatorView.startAnimating() : self.activityIndicatorView.stopAnimating()
if $0 {
self.activityIndicatorView.startAnimating()
} else {
self.activityIndicatorView.stopAnimating()
}
}
}

View file

@ -183,8 +183,12 @@ extension PollView {
let open = !poll.expired && !poll.voted
for option in poll.options {
height += open ? PollOptionButton.estimatedHeight(width: width, title: option.title)
: PollResultView.estimatedHeight(width: width, title: option.title)
if open {
height += PollOptionButton.estimatedHeight(width: width, title: option.title)
} else {
height += PollResultView.estimatedHeight(width: width, title: option.title)
}
height += .defaultSpacing
}