|
|
@ -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")?
|
|
|
|
|
|
|
|
.withRenderingMode(.alwaysTemplate)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onTap: {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
return SessionCell.Info(
|
|
|
|
)
|
|
|
|
id: Item(title: title),
|
|
|
|
]
|
|
|
|
title: title,
|
|
|
|
|
|
|
|
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:
|
|
|
|