|
|
@ -118,7 +118,8 @@ extension ContextMenuVC {
|
|
|
|
|
|
|
|
|
|
|
|
subtitleLabel.isHidden = false
|
|
|
|
subtitleLabel.isHidden = false
|
|
|
|
subtitleWidthConstraint.isActive = true
|
|
|
|
subtitleWidthConstraint.isActive = true
|
|
|
|
let timeToExpireInSeconds: TimeInterval = (expiresStartedAtMs + expiresInSeconds * 1000 - Double(SnodeAPI.currentOffsetTimestampMs())) / 1000
|
|
|
|
// To prevent a negative timer
|
|
|
|
|
|
|
|
let timeToExpireInSeconds: TimeInterval = max(0, (expiresStartedAtMs + expiresInSeconds * 1000 - Double(SnodeAPI.currentOffsetTimestampMs())) / 1000)
|
|
|
|
subtitleLabel.text = String(format: "DISAPPEARING_MESSAGES_AUTO_DELETES_COUNT_DOWN".localized(), timeToExpireInSeconds.formatted(format: .twoUnits))
|
|
|
|
subtitleLabel.text = String(format: "DISAPPEARING_MESSAGES_AUTO_DELETES_COUNT_DOWN".localized(), timeToExpireInSeconds.formatted(format: .twoUnits))
|
|
|
|
|
|
|
|
|
|
|
|
timer = Timer.scheduledTimerOnMainThread(withTimeInterval: 1, repeats: true, block: { [weak self] _ in
|
|
|
|
timer = Timer.scheduledTimerOnMainThread(withTimeInterval: 1, repeats: true, block: { [weak self] _ in
|
|
|
|