Various fixes

This commit is contained in:
Ilya Laktyushin
2023-02-20 04:30:51 +04:00
parent b529625219
commit 980a2c47bc
25 changed files with 262 additions and 113 deletions

View File

@@ -1354,10 +1354,24 @@ open class NavigationController: UINavigationController, ContainableController,
public func replaceControllersAndPush(controllers: [UIViewController], controller: ViewController, animated: Bool, options: NavigationAnimationOptions = [], ready: ValuePromise<Bool>? = nil, completion: @escaping () -> Void = {}) {
ready?.set(true)
var controllers = controllers
controllers.append(controller)
self.setViewControllers(controllers, animated: animated)
completion()
let action = { [weak self] in
guard let self else {
return
}
var controllers = controllers
controllers.append(controller)
self.setViewControllers(controllers, animated: animated)
completion()
}
if let rootContainer = self.rootContainer, case let .split(container) = rootContainer, let topController = container.detailControllers.last {
if topController.attemptNavigation({
action()
}) {
action()
}
} else {
action()
}
}
public func replaceControllers(controllers: [UIViewController], animated: Bool, options: NavigationAnimationOptions = [], ready: ValuePromise<Bool>? = nil, completion: @escaping () -> Void = {}) {

View File

@@ -1654,7 +1654,7 @@ open class TextNode: ASDisplayNode {
return (layout, {
node.cachedLayout = layout
if updated {
if layout.size.width.isZero && layout.size.height.isZero {
if layout.size.width.isZero || layout.size.height.isZero {
node.contents = nil
}
node.setNeedsDisplay()