mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 12:56:13 -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
|
||||
if navigationAction.modifierFlags.contains(.command) {
|
||||
// create new tab
|
||||
guard let currentWindow = NSApp.keyWindow,
|
||||
let windowController = currentWindow.windowController else {
|
||||
decisionHandler(.allow)
|
||||
guard let currentWindow = NSApp.keyWindow, let windowController = currentWindow.windowController else { decisionHandler(.allow)
|
||||
return
|
||||
}
|
||||
// store the new url in a static way
|
||||
@ -242,8 +240,7 @@ final class BrowserViewModel: NSObject, ObservableObject,
|
||||
windowController.newWindowForTab(self)
|
||||
// now reset the static url to nil, as the new BrowserViewModel already has it
|
||||
BrowserViewModel.urlForNewTab = nil
|
||||
guard let newWindow = NSApp.keyWindow, currentWindow != newWindow else {
|
||||
decisionHandler(.allow)
|
||||
guard let newWindow = NSApp.keyWindow, currentWindow != newWindow else { decisionHandler(.allow)
|
||||
return
|
||||
}
|
||||
currentWindow.addTabbedWindow(newWindow, ordered: .above)
|
||||
|
Loading…
x
Reference in New Issue
Block a user