Skip to content

Commit

Permalink
Merge branch 'pj/fix/VPNAPPL-2102-retain-cycle-video-tour' into 'deve…
Browse files Browse the repository at this point in the history
…lop'

Merge-Request: apple/vpn/protonvpn!1598
Approved-by: Adam Viaud <[email protected]>
  • Loading branch information
pawel-jurczyk committed Feb 12, 2024
2 parents 3c046a8 + d8d5ad5 commit f0f94a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ class SystemExtensionGuideViewController: NSViewController {
super.viewDidLoad()
NotificationCenter.default
.publisher(for: SystemExtensionManager.allExtensionsInstalled)
.sink(receiveValue: allExtensionsInstalled)
.sink(receiveValue: { [weak self] _ in
self?.allExtensionsInstalled()
})
.store(in: &cancellables)
}

func allExtensionsInstalled(_ notification: Notification) {
func allExtensionsInstalled() {
finishedTour = true
self.view.window?.close()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ class VideoTourModel {
player.rate = 0.5
NotificationCenter.default
.publisher(for: .AVPlayerItemDidPlayToEndTime, object: player.currentItem)
.sink(receiveValue: itemDidPlayToEndTime)
.sink(receiveValue: { [weak self] _ in
self?.itemDidPlayToEndTime()
})
.store(in: &cancellables)
}

private func itemDidPlayToEndTime(_ notification: Notification) {
private func itemDidPlayToEndTime() {
player.seek(to: .zero)
player.play()
}
Expand Down

0 comments on commit f0f94a0

Please sign in to comment.