Skip to content

Commit

Permalink
Merge pull request #899 from kiwix/898-continue-playing-video-even-wh…
Browse files Browse the repository at this point in the history
…en-kiwix-app-has-not-the-focus-anymore

Fix window will close notification, making sure it's from our window
  • Loading branch information
kelson42 authored Aug 2, 2024
2 parents c7255f8 + 70d6386 commit 7d4b5b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion App/App_macOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ struct RootView: View {
navigation.currentItem = .reading
browser.load(url: url)
}
.onReceive(tabCloses) { _ in
.onReceive(tabCloses) { publisher in
guard windowTracker.current == publisher.object as? NSWindow else {
// when exiting full screen video, we get the same notification
// but that's not comming from our window
return
}
guard !navigation.isTerminating else {
// tab closed by app termination
return
Expand Down

0 comments on commit 7d4b5b7

Please sign in to comment.