mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-12 18:59:59 +02:00
Merge pull request #1715 from vector-im/loop_again
App Startup: patchy patch: Reenable the loop on [application isProtecedDataAvailable]
This commit is contained in:
+12
-11
@@ -345,18 +345,19 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
||||
// as advised at https://forums.developer.apple.com/thread/15685#45849.
|
||||
// So, there is no more need to loop (sometimes forever) until
|
||||
// [application isProtectedDataAvailable] becomes YES.
|
||||
// NSUInteger loopCount = 0;
|
||||
// But, as we are not so sure, loop but no more than 10s.
|
||||
// TODO: Remove this loop.
|
||||
NSUInteger loopCount = 0;
|
||||
|
||||
// // Check whether the content protection is active before going further.
|
||||
// // Should fix the spontaneous logout.
|
||||
// while (![application isProtectedDataAvailable])
|
||||
// {
|
||||
// // Wait for protected data.
|
||||
// [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.2f]];
|
||||
// }
|
||||
//
|
||||
// NSLog(@"[AppDelegate] didFinishLaunchingWithOptions (%tu)", loopCount);
|
||||
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: isProtectedDataAvailable: %@", @([application isProtectedDataAvailable]));
|
||||
// Check whether the content protection is active before going further.
|
||||
// Should fix the spontaneous logout.
|
||||
while (![application isProtectedDataAvailable] && loopCount++ < 50)
|
||||
{
|
||||
// Wait for protected data.
|
||||
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.2f]];
|
||||
}
|
||||
|
||||
NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: isProtectedDataAvailable: %@ (%tu)", @([application isProtectedDataAvailable]), loopCount);
|
||||
|
||||
// Log app information
|
||||
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
|
||||
|
||||
Reference in New Issue
Block a user