Merge pull request #662 from mastodon/report_post_next

Always allow to continue when reporting a post if at least one is selected
This commit is contained in:
Marcus Kida 2022-11-22 08:27:06 +01:00 committed by GitHub
commit d98306b505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -123,6 +123,10 @@ extension ReportStatusViewController {
.assign(to: \.isEnabled, on: navigationActionView.nextButton)
.store(in: &disposeBag)
if !viewModel.selectStatuses.isEmpty {
navigationActionView.hidesBackButton = true
}
navigationActionView.backButton.addTarget(self, action: #selector(ReportStatusViewController.skipButtonDidPressed(_:)), for: .touchUpInside)
navigationActionView.nextButton.addTarget(self, action: #selector(ReportStatusViewController.nextButtonDidPressed(_:)), for: .touchUpInside)
}

View File

@ -71,9 +71,7 @@ class ReportStatusViewModel {
}
$selectStatuses
.map { statuses -> Bool in
return status == nil ? !statuses.isEmpty : statuses.count > 1
}
.map { !$0.isEmpty }
.assign(to: &$isNextButtonEnabled)
}