mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 14:35:03 -04:00
Fixes code factor
This commit is contained in:
parent
39aa8df436
commit
3d29a583a1
@ -231,9 +231,7 @@ final class BrowserViewModel: NSObject, ObservableObject,
|
|||||||
// detect cmd + click event
|
// detect cmd + click event
|
||||||
if navigationAction.modifierFlags.contains(.command) {
|
if navigationAction.modifierFlags.contains(.command) {
|
||||||
// create new tab
|
// create new tab
|
||||||
guard let currentWindow = NSApp.keyWindow,
|
guard let currentWindow = NSApp.keyWindow, let windowController = currentWindow.windowController else { decisionHandler(.allow)
|
||||||
let windowController = currentWindow.windowController else {
|
|
||||||
decisionHandler(.allow)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// store the new url in a static way
|
// store the new url in a static way
|
||||||
@ -242,8 +240,7 @@ final class BrowserViewModel: NSObject, ObservableObject,
|
|||||||
windowController.newWindowForTab(self)
|
windowController.newWindowForTab(self)
|
||||||
// now reset the static url to nil, as the new BrowserViewModel already has it
|
// now reset the static url to nil, as the new BrowserViewModel already has it
|
||||||
BrowserViewModel.urlForNewTab = nil
|
BrowserViewModel.urlForNewTab = nil
|
||||||
guard let newWindow = NSApp.keyWindow, currentWindow != newWindow else {
|
guard let newWindow = NSApp.keyWindow, currentWindow != newWindow else { decisionHandler(.allow)
|
||||||
decisionHandler(.allow)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
currentWindow.addTabbedWindow(newWindow, ordered: .above)
|
currentWindow.addTabbedWindow(newWindow, ordered: .above)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user