mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Add global timer tooltip
This commit is contained in:
parent
aef2a382f7
commit
2073f13e56
@ -226,6 +226,7 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
||||
var state = state
|
||||
state.updatedValue = timeout
|
||||
if timeout != 0 {
|
||||
state.additionalValues.removeAll()
|
||||
state.additionalValues.insert(timeout)
|
||||
}
|
||||
return state
|
||||
@ -356,6 +357,21 @@ public func globalAutoremoveScreen(context: AccountContext, initialValue: Int32,
|
||||
let _ = (context.engine.peers.setChatMessageAutoremoveTimeouts(peerIds: peerIds, timeout: value)
|
||||
|> deliverOnMainQueue).start(completed: {
|
||||
selectionController?.dismiss()
|
||||
|
||||
let isOn: Bool = true
|
||||
//TODO:localize
|
||||
let text = "You applied the \(timeIntervalString(strings: presentationData.strings, value: value)) self-destruct timer to \(peerIds.count) \(peerIds.count == 1 ? "chat" : "chats")."
|
||||
|
||||
var animateAsReplacement = false
|
||||
if let window = getController?()?.window {
|
||||
window.forEachController { other in
|
||||
if let other = other as? UndoOverlayController {
|
||||
animateAsReplacement = true
|
||||
other.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
presentControllerImpl?(UndoOverlayController(presentationData: presentationData, content: .autoDelete(isOn: isOn, title: nil, text: text), elevatedLayout: false, animateInAsReplacement: animateAsReplacement, action: { _ in return false }), nil)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user