mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Close all secondary windows on logout
This commit is contained in:
committed by
Stefan Ceriu
parent
deaa2727db
commit
891c3fffd4
@@ -20,6 +20,7 @@ class WindowManager: SecureWindowManagerProtocol {
|
||||
private(set) var alternateWindow: UIWindow!
|
||||
|
||||
private(set) var openWindowAction: OpenWindowAction!
|
||||
private(set) var dismissWindowAction: DismissWindowAction!
|
||||
|
||||
var windows: [UIWindow] {
|
||||
[mainWindow, overlayWindow, globalSearchWindow, alternateWindow]
|
||||
@@ -58,8 +59,10 @@ class WindowManager: SecureWindowManagerProtocol {
|
||||
delegate?.windowManagerDidConfigureWindows(self)
|
||||
}
|
||||
|
||||
func configure(with openWindowAction: OpenWindowAction) {
|
||||
func configure(withOpenWinddowAction openWindowAction: OpenWindowAction,
|
||||
dismissWindowAction: DismissWindowAction) {
|
||||
self.openWindowAction = openWindowAction
|
||||
self.dismissWindowAction = dismissWindowAction
|
||||
}
|
||||
|
||||
func registerCoordinator(_ coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, forWindowType type: WindowManagerWindowType) {
|
||||
@@ -67,6 +70,14 @@ class WindowManager: SecureWindowManagerProtocol {
|
||||
openWindowAction(value: type)
|
||||
}
|
||||
|
||||
func closeAllAuxiliaryWindows() {
|
||||
for key in coordinators.keys {
|
||||
dismissWindowAction(value: key)
|
||||
}
|
||||
|
||||
coordinators.removeAll()
|
||||
}
|
||||
|
||||
func windowForType(_ type: WindowManagerWindowType) -> AnyView {
|
||||
guard let coordinator = coordinators[type]?.coordinator else {
|
||||
return AnyView(InstantlyDismissingWindow())
|
||||
|
||||
Reference in New Issue
Block a user