Merge pull request #1809 from vector-im/riot_1798

Fix screen flashing at startup
This commit is contained in:
manuroe 2018-03-09 14:51:36 +01:00 committed by GitHub
commit eb23bd12bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2468,7 +2468,13 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
if (mxSession)
{
// Report this session to contact manager
[[MXKContactManager sharedManager] addMatrixSession:mxSession];
// But wait a bit that our launch animation screen is ready to show and
// displayed if needed. As the processing in MXKContactManager can lock
// the UI thread for several seconds, it is better to show the animation
// during this blocking task.
dispatch_after(dispatch_walltime(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[[MXKContactManager sharedManager] addMatrixSession:mxSession];
});
// Update home data sources
[_masterTabBarController addMatrixSession:mxSession];