Issue-1206 - Remove unneccessary view model
This commit is contained in:
parent
8d97b5a51e
commit
eef7c04912
|
@ -217,6 +217,7 @@ GEM
|
|||
PLATFORMS
|
||||
arm64-darwin-21
|
||||
arm64-darwin-22
|
||||
arm64-darwin-23
|
||||
x86_64-darwin-21
|
||||
x86_64-darwin-22
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue