Dismiss a room's window when its flow finishes as there's no longer a reason for it to be alive.

This commit is contained in:
Stefan Ceriu
2026-03-30 14:27:06 +03:00
committed by Stefan Ceriu
parent ac5b61c973
commit bb61db285b
4 changed files with 13 additions and 0 deletions
@@ -174,6 +174,10 @@ class WindowManager: SecureWindowManagerProtocol {
func lockOrientation(_ orientation: UIInterfaceOrientationMask) {
appDelegate.orientationLock = orientation
}
func closeAuxiliaryWindow(forType type: WindowManagerWindowType) {
dismissWindowAction(value: type)
}
}
private class PassthroughWindow: UIWindow {
@@ -62,6 +62,9 @@ protocol WindowManagerProtocol: AnyObject, OrientationManagerProtocol {
func showGlobalSearch()
func hideGlobalSearch()
/// Closes a previously opened window for the given type.
func closeAuxiliaryWindow(forType type: WindowManagerWindowType)
}
// sourcery: AutoMockable
@@ -900,6 +900,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
// iPhone the compact module diffs call the dismissal callback and we present a blank space flow 🙈
if spaceRoomListProxy == nil {
navigationStackCoordinator.setRootCoordinator(nil, animated: false)
flowParameters.windowManager.closeAuxiliaryWindow(forType: .room(roomID: roomProxy.id))
}
}
@@ -21462,8 +21462,13 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable {
}
var showGlobalSearchCalled: Bool {
return showGlobalSearchCallsCount > 0
var closeAuxiliaryWindowForTypeCalled: Bool {
return closeAuxiliaryWindowForTypeCallsCount > 0
}
var showGlobalSearchClosure: (() -> Void)?
var closeAuxiliaryWindowForTypeReceivedType: WindowManagerWindowType?
var closeAuxiliaryWindowForTypeReceivedInvocations: [WindowManagerWindowType] = []
var closeAuxiliaryWindowForTypeClosure: ((WindowManagerWindowType) -> Void)?
func showGlobalSearch() {
showGlobalSearchCallsCount += 1