|
|
@ -95,7 +95,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|
|
|
set { setCurrentItem(newValue, direction: .forward, animated: false) }
|
|
|
|
set { setCurrentItem(newValue, direction: .forward, animated: false) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private var cachedPages: [SignalAttachmentItem: AttachmentPrepViewController] = [:]
|
|
|
|
private var cachedPages: [UUID: AttachmentPrepViewController] = [:]
|
|
|
|
|
|
|
|
|
|
|
|
public var shouldHideControls: Bool {
|
|
|
|
public var shouldHideControls: Bool {
|
|
|
|
guard let pageViewController: AttachmentPrepViewController = pageViewControllers?.first else {
|
|
|
|
guard let pageViewController: AttachmentPrepViewController = pageViewControllers?.first else {
|
|
|
@ -477,7 +477,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private func buildPage(item: SignalAttachmentItem) -> AttachmentPrepViewController? {
|
|
|
|
private func buildPage(item: SignalAttachmentItem) -> AttachmentPrepViewController? {
|
|
|
|
if let cachedPage = cachedPages[item] {
|
|
|
|
if let cachedPage = cachedPages[item.uniqueIdentifier] {
|
|
|
|
Log.debug("[AttachmentApprovalViewController] cache hit.")
|
|
|
|
Log.debug("[AttachmentApprovalViewController] cache hit.")
|
|
|
|
return cachedPage
|
|
|
|
return cachedPage
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -485,7 +485,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
|
|
|
|
Log.debug("[AttachmentApprovalViewController] cache miss.")
|
|
|
|
Log.debug("[AttachmentApprovalViewController] cache miss.")
|
|
|
|
let viewController = AttachmentPrepViewController(attachmentItem: item, using: dependencies)
|
|
|
|
let viewController = AttachmentPrepViewController(attachmentItem: item, using: dependencies)
|
|
|
|
viewController.prepDelegate = self
|
|
|
|
viewController.prepDelegate = self
|
|
|
|
cachedPages[item] = viewController
|
|
|
|
cachedPages[item.uniqueIdentifier] = viewController
|
|
|
|
|
|
|
|
|
|
|
|
return viewController
|
|
|
|
return viewController
|
|
|
|
}
|
|
|
|
}
|
|
|
|