Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

Merge branch 'bp/ota' into feat/setup-cli

raymondchins968a28ab4c12
diff --cc app/Sources/NotProtonApp/App.swift
index bc72c3f,0490677..b33d0ea
--- a/app/Sources/NotProtonApp/App.swift
+++ b/app/Sources/NotProtonApp/App.swift
@@@ -25,23 -25,10 +25,25 @@@ struct NotProtonApp: App
if prefixes.hasLoaded { Task { await prefixes.load() } }
}
.onChange(of: status.snapshot == nil, initial: true) {
- if SetupAssistant.shouldShow(status.snapshot) { showsSetup = true }
+ if SetupAssistant.shouldShow(status.snapshot) {
+ showsSetup = true
+ } else if status.snapshot != nil {
+ checkSteamPatch("launch")
+ }
+ }
+ // A Steam client update rewrites Steam.app and drops Bridgeplay with it, so
+ // look again whenever the user comes back and every few minutes.
+ .onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
+ checkSteamPatch("foreground")
+ }
+ .task {
+ while !Task.isCancelled {
+ try? await Task.sleep(for: SteamPatchKeeper.pollInterval)
+ checkSteamPatch("timer")
+ }
}
+ .onChange(of: status.snapshot?.steam, initial: true) { refreshAfterUpdate() }
+ .onChange(of: status.isIdle) { refreshAfterUpdate() }
.sheet(isPresented: $showsSetup) {
SetupAssistantView()
.environment(status)