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
|
@ -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> {
|
||||
|
|
|
@ -116,18 +116,17 @@ private extension CompositionPollView {
|
|||
|
||||
addChoiceButton.isEnabled = $0.count < CompositionViewModel.maxPollOptionCount
|
||||
|
||||
for (index, option) in $0.enumerated() {
|
||||
if !self.pollOptionViews.contains(where: { $0.option === option }) {
|
||||
let optionView = CompositionPollOptionView(
|
||||
viewModel: self.viewModel,
|
||||
parentViewModel: self.parentViewModel,
|
||||
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,
|
||||
option: option)
|
||||
|
||||
optionView.textField.placeholder = String.localizedStringWithFormat(
|
||||
NSLocalizedString("status.poll.option-%ld", comment: ""),
|
||||
index + 1)
|
||||
self.stackView.insertArrangedSubview(optionView, at: index)
|
||||
}
|
||||
optionView.textField.placeholder = String.localizedStringWithFormat(
|
||||
NSLocalizedString("status.poll.option-%ld", comment: ""),
|
||||
index + 1)
|
||||
self.stackView.insertArrangedSubview(optionView, at: index)
|
||||
}
|
||||
|
||||
for (index, optionView) in self.pollOptionViews.enumerated() {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue