mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Attachment menu improvements
This commit is contained in:
@@ -158,6 +158,12 @@ private func attachmentFileControllerEntries(presentationData: PresentationData,
|
||||
|
||||
private class AttachmentFileControllerImpl: ItemListController, AttachmentContainable {
|
||||
public var requestAttachmentMenuExpansion: () -> Void = {}
|
||||
|
||||
var prepareForReuseImpl: () -> Void = {}
|
||||
public func prepareForReuse() {
|
||||
self.prepareForReuseImpl()
|
||||
self.scrollToTop?()
|
||||
}
|
||||
}
|
||||
|
||||
private struct AttachmentFileControllerState: Equatable {
|
||||
@@ -259,6 +265,13 @@ public func attachmentFileController(context: AccountContext, updatedPresentatio
|
||||
}
|
||||
|
||||
let controller = AttachmentFileControllerImpl(context: context, state: signal)
|
||||
controller.prepareForReuseImpl = {
|
||||
updateState { state in
|
||||
var updatedState = state
|
||||
updatedState.searching = false
|
||||
return updatedState
|
||||
}
|
||||
}
|
||||
dismissImpl = { [weak controller] in
|
||||
controller?.dismiss(animated: true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user