don't start other pollers when app is activated in backgroud

pull/1053/head
Ryan ZHAO 10 months ago
parent 780e262e52
commit fc4778e79f

@ -353,7 +353,7 @@ final class HomeVC: BaseVC, LibSessionRespondingViewController, UITableViewDataS
)
// Start polling if needed (i.e. if the user just created or restored their Session ID)
if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate {
if Identity.userExists(), let appDelegate: AppDelegate = UIApplication.shared.delegate as? AppDelegate, !Singleton.appContext.isInBackground {
SNLog("[HomeVC]: Starting pollers...")
appDelegate.startPollersIfNeeded()
}

@ -284,7 +284,8 @@ public enum PushRegistrationError: Error {
guard
let uuid: String = payload["uuid"] as? String,
let caller: String = payload["caller"] as? String,
let timestampMs: Int64 = payload["timestamp"] as? Int64
let timestampMs: UInt64 = payload["timestamp"] as? UInt64,
TimestampUtils.isWithinOneMinute(timestampMs: timestampMs)
else {
SessionCallManager.reportFakeCall(info: "Missing payload data") // stringlint:ignore
return

Loading…
Cancel
Save