Network Type Transition Optimization

Nucleic-Session: 40F8C53A-F001-423A-8607-EAE181DBE14B
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-04 23:40:00 -07:00
co-authored by Nucleic
parent 087f49d592
commit efc7e4c7fb
@@ -28,7 +28,12 @@ struct NucleicRemoteApp: App {
// activity flag current so it only notifies for background transitions. // activity flag current so it only notifies for background transitions.
.onChange(of: scenePhase) { _, phase in .onChange(of: scenePhase) { _, phase in
store.setScenePhaseActive(phase == .active) 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() }
}
} }
} }
} }