From ca2f533b2bd4ecc7aa111ca82bb2c1ed8eab0dc4 Mon Sep 17 00:00:00 2001 From: giomfo Date: Tue, 31 Jan 2017 16:50:28 +0100 Subject: [PATCH] Bug Fix - App stuck in Riot animation on cold start #964 Fix the case where the App is launched on a Riot notification. --- Vector/ViewController/HomeViewController.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Vector/ViewController/HomeViewController.m b/Vector/ViewController/HomeViewController.m index a6f4483ed..a1e5081f9 100644 --- a/Vector/ViewController/HomeViewController.m +++ b/Vector/ViewController/HomeViewController.m @@ -715,8 +715,10 @@ if (mainSession) { - if (mainSession.state < MXSessionStateStoreDataReady || - ([recentsViewController.recentsTableView numberOfSections] == 0 && [AppDelegate theDelegate].isOffline == NO)) + // Display the Riot animation until the stored data are ready. + // When the stored data are ready, keep the animation running if the recents table + // is not rendered yet (except in offline mode, or if a room has been selected). + if (mainSession.state < MXSessionStateStoreDataReady || ([recentsViewController.recentsTableView numberOfSections] == 0 && [AppDelegate theDelegate].isOffline == NO && _currentRoomViewController == nil)) { if (!launchAnimationContainerView) { @@ -1006,6 +1008,9 @@ // controller.navigationItem.leftItemsSupplementBackButton = YES; } + + // Remove the Riot animation as soon as a room is selected. + [self handleLaunchAnimation]; } else {