1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-30 08:42:18 +03:00

Fix closing logic for temporary sessions

This commit is contained in:
Tae Won Ha 2019-03-29 14:46:52 +01:00
parent 8b6c7170fe
commit 6ee4b74b45
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -81,15 +81,23 @@ class UiRootReducer: ReducerType {
case .close:
if appState.mainWindows[uuid]?.isTemporarySession == true {
if appState.currentMainWindowUuid == uuid {
appState.currentMainWindowUuid = nil
}
appState.mainWindows.removeValue(forKey: uuid)
break
}
if appState.currentMainWindowUuid == uuid, let mainWindowToClose = appState.mainWindows[uuid] {
appState.mainWindowTemplate = self.mainWindowTemplate(from: appState.mainWindowTemplate,
new: mainWindowToClose,
isFullScreen: false)
if appState.currentMainWindowUuid == uuid,
let mainWindowToClose = appState.mainWindows[uuid] {
appState.currentMainWindowUuid = nil
appState.mainWindowTemplate = self.mainWindowTemplate(
from: appState.mainWindowTemplate,
new: mainWindowToClose,
isFullScreen: false
)
}
appState.mainWindows.removeValue(forKey: uuid)