Skip to content

Commit a88669f

Browse files
authored
Merge pull request #968 from kiwix/962-regression-opening-app-with-zim-doesnt-open-zim
Fix opening app with ZIM doesn't open ZIM
2 parents 28ee7db + b13e466 commit a88669f

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

App/App_macOS.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ struct RootView: View {
194194
browser.load(url: url)
195195
}
196196
.onReceive(tabCloses) { publisher in
197+
// closing one window either by CMD+W || red(X) close button
197198
guard windowTracker.current == publisher.object as? NSWindow else {
198199
// when exiting full screen video, we get the same notification
199200
// but that's not comming from our window
@@ -210,8 +211,8 @@ struct RootView: View {
210211
}
211212
}
212213
.onReceive(appTerminates) { _ in
214+
// CMD+Q -> Quit Kiwix, this also closes the last window
213215
navigation.isTerminating = true
214-
browser.persistAllTabIdsFromWindows()
215216
}.task {
216217
switch AppType.current {
217218
case .kiwix:

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 3.5.2
2-
2+
- FIX:
3+
- Opening ZIM file from macOS Finder (@BPerlakiH #968)
34

45
## 3.5.1
56
- FIX:

ViewModel/BrowserViewModel.swift

-7
Original file line numberDiff line numberDiff line change
@@ -597,13 +597,6 @@ final class BrowserViewModel: NSObject, ObservableObject,
597597
}
598598

599599
// PERSISTENCE:
600-
func persistAllTabIdsFromWindows() {
601-
let urls = NSApplication.shared.windows.compactMap { window in
602-
window.accessibilityURL()
603-
}
604-
UserDefaults.standard[.windowURLs] = urls
605-
}
606-
607600
private func storeTabIDInCurrentWindow() {
608601
guard let tabID,
609602
let windowNumber,

0 commit comments

Comments
 (0)