Issue-1206 - Remove unneccessary view model

This commit is contained in:
Ali Ali 2024-05-06 20:52:40 +10:00
parent 8d97b5a51e
commit eef7c04912
3 changed files with 6 additions and 16 deletions

View File

@ -217,6 +217,7 @@ GEM
PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-21
x86_64-darwin-22

View File

@ -50,7 +50,7 @@ extension ReportSection {
context: context,
tableView: tableView,
cell: cell,
viewModel: .init(value: status),
status: status,
configuration: configuration
)
return cell
@ -86,7 +86,7 @@ extension ReportSection {
context: AppContext,
tableView: UITableView,
cell: ReportStatusTableViewCell,
viewModel: ReportStatusTableViewCell.ViewModel,
status: MastodonStatus,
configuration: Configuration
) {
StatusSection.setupStatusPollDataSource(
@ -100,7 +100,7 @@ extension ReportSection {
cell.configure(
tableView: tableView,
viewModel: viewModel
status: status
)
}

View File

@ -8,29 +8,18 @@
import UIKit
import MastodonSDK
extension ReportStatusTableViewCell {
// todo: refactor / remove this
final class ViewModel {
let value: MastodonStatus
init(value: MastodonStatus) {
self.value = value
}
}
}
extension ReportStatusTableViewCell {
func configure(
tableView: UITableView,
viewModel: ViewModel
status: MastodonStatus
) {
if statusView.frame == .zero {
// set status view width
statusView.frame.size.width = tableView.frame.width - ReportStatusTableViewCell.checkboxLeadingMargin - ReportStatusTableViewCell.checkboxSize.width - ReportStatusTableViewCell.statusViewLeadingSpacing
}
statusView.configure(status: viewModel.value)
statusView.configure(status: status)
statusView.viewModel.$isContentReveal
.removeDuplicates()