update disappearing message settings timer section

pull/941/head
ryanzhao 2 years ago
parent d01cda454c
commit fee64b6bf0

@ -144,19 +144,26 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel<ThreadDisappear
(currentSelection.isEnabled == false) ? nil : (currentSelection.isEnabled == false) ? nil :
SectionModel( SectionModel(
model: .timer, model: .timer,
elements: [ elements: DisappearingMessagesConfiguration
SessionCell.Info( .validDurationsSeconds(.disappearAfterRead)
id: Item(title: "Current Setting"), .map { duration in
title: currentSelection.durationSeconds.formatted(format: .long), let title: String = duration.formatted(format: .long)
rightAccessory: .icon(
UIImage(named: "ic_chevron_down")? return SessionCell.Info(
.withRenderingMode(.alwaysTemplate) id: Item(title: title),
), title: title,
onTap: { rightAccessory: .radio(
isSelected: { (self?.currentSelection.value.isEnabled == true) && (self?.currentSelection.value.durationSeconds == duration) }
} ),
) onTap: {
] let updatedConfig: DisappearingMessagesConfiguration = currentSelection
.with(
durationSeconds: duration
)
self?.currentSelection.send(updatedConfig)
}
)
}
) )
) )
case .closedGroup: case .closedGroup:

Loading…
Cancel
Save