mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Stop and resume DD Session Replay on app backgrounding and activation to prevent crashes
This commit is contained in:
parent
beb990e6ef
commit
6cdcb96967
1 changed files with 5 additions and 0 deletions
|
|
@ -196,6 +196,9 @@ struct MeshtasticAppleApp: App {
|
|||
switch newScenePhase {
|
||||
case .background:
|
||||
Logger.services.info("🎬 [App] Scene is in the background")
|
||||
// Stop Session Replay when app goes to background to prevent crashes
|
||||
// from accessing SwiftUI view hierarchy while backgrounded
|
||||
SessionReplay.stopRecording()
|
||||
accessoryManager.appDidEnterBackground()
|
||||
do {
|
||||
try persistenceController.container.viewContext.save()
|
||||
|
|
@ -209,6 +212,8 @@ struct MeshtasticAppleApp: App {
|
|||
Logger.services.info("🎬 [App] Scene is inactive")
|
||||
case .active:
|
||||
Logger.services.info("🎬 [App] Scene is active")
|
||||
// Resume Session Replay when app becomes active
|
||||
SessionReplay.startRecording()
|
||||
accessoryManager.appDidBecomeActive()
|
||||
@unknown default:
|
||||
Logger.services.error("🍎 [App] Apple must have changed something")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue