Skip to content

Commit 63cba93

Browse files
committed
Merge branch '23-url-event-racing'
2 parents 6081298 + 237ba28 commit 63cba93

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

devdocs-macos/AppDelegate.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ public extension Notification.Name {
99
class AppDelegate: NSObject, NSApplicationDelegate {
1010
func applicationWillFinishLaunching(_ notification: Notification) {
1111
let _ = DocumentationWindows.shared
12+
URLEventHandler.shared.install()
1213
}
1314

1415
func applicationDidFinishLaunching(_ aNotification: Notification) {
1516
Summoner.shared.install()
16-
URLEventHandler.shared.install()
17-
DocumentationWindows.shared.restore()
17+
18+
if GeneralPreferences.shouldRestoreDocs() {
19+
DocumentationWindows.shared.restore()
20+
}
21+
22+
DispatchQueue.main.async {
23+
DocumentationWindows.shared.newWindowIfNoWindow()
24+
}
1825
}
1926

2027
func applicationWillTerminate(_ aNotification: Notification) {

devdocs-macos/DocumentationWindows.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ class DocumentationWindows: NSObject {
4444
}
4545

4646
func restore() {
47-
if !GeneralPreferences.shouldRestoreDocs() {
48-
newWindow()
49-
return
50-
}
5147
if let urls = Storage.getLocations() {
5248
urls.filter { url -> Bool in
5349
if let host = url.host {
@@ -58,8 +54,6 @@ class DocumentationWindows: NSObject {
5854
}.forEach { url in
5955
newWindow(forURL: url)
6056
}
61-
} else {
62-
newWindow()
6357
}
6458
}
6559
}

0 commit comments

Comments
 (0)