Skip to content

Commit aa76bfa

Browse files
committed
set launch state correctly
// FREEBIE
1 parent 6479327 commit aa76bfa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Signal/src/AppDelegate.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
101101
[self prepareScreenProtection];
102102

103103
// Avoid blocking app launch by putting all possible DB access in async thread.
104+
UIApplicationState launchState = application.applicationState;
104105
[TSAccountManager runIfRegistered:^{
105-
if (application.applicationState == UIApplicationStateInactive) {
106+
if (launchState == UIApplicationStateInactive) {
107+
DDLogWarn(@"The app was launched from inactive");
106108
[TSSocketManager becomeActiveFromForeground];
107-
} else if (application.applicationState == UIApplicationStateBackground) {
109+
} else if (launchState == UIApplicationStateBackground) {
110+
DDLogWarn(@"The app was launched from being backgrounded");
108111
[TSSocketManager becomeActiveFromBackgroundExpectMessage:NO];
109112
} else {
110113
DDLogWarn(@"The app was launched in an unknown way");

0 commit comments

Comments
 (0)