From d42088e37c6f48281ffe2386a512017e496ab3fc Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Mon, 5 Sep 2022 15:45:30 +1000 Subject: [PATCH] fix an edge case where the isCallOngoing will always be true --- Session/Meta/AppDelegate.swift | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index aeaa99275..740f053c3 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -78,6 +78,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD SNAppearance.switchToSessionAppearance() + if Environment.shared?.callManager.wrappedValue?.currentCall == nil { + UserDefaults.sharedLokiProject?.set(false, forKey: "isCallOngoing") + } + // No point continuing if we are running tests guard !CurrentAppContext().isRunningTests else { return true } @@ -142,16 +146,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } } - func applicationDidReceiveMemoryWarning(_ application: UIApplication) { - Logger.info("applicationDidReceiveMemoryWarning") - } - - func applicationWillTerminate(_ application: UIApplication) { - DDLog.flushLog() - - stopPollers() - } - func applicationDidBecomeActive(_ application: UIApplication) { guard !CurrentAppContext().isRunningTests else { return }