diff --git a/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift b/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift index 267c7c1..c8132f1 100644 --- a/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift +++ b/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift @@ -28,7 +28,12 @@ struct NucleicRemoteApp: App { // activity flag current so it only notifies for background transitions. .onChange(of: scenePhase) { _, phase in store.setScenePhaseActive(phase == .active) - if phase == .active { Task { await HeartbeatReporter.reportIfDue() } } + if phase == .active { + // Re-plan transports immediately on foreground — the network may have + // changed while suspended, so don't wait for a dead socket to notice. + store.onForeground() + Task { await HeartbeatReporter.reportIfDue() } + } } } }