From e4af9032e277c779750c08cd0f9a5ca52c8ca559 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 11 Jul 2015 21:59:41 -0700 Subject: [PATCH] Implement a fast path to the app grid for online, paired machines with cached app lists. --- Limelight/ViewControllers/MainFrameViewController.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index a4fa8570..37602c3b 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -182,8 +182,19 @@ static NSMutableSet* hostList; } Log(LOG_D, @"Clicked host: %@", host.name); - [self showLoadingFrame]; _selectedHost = host; + + // If we are online, paired, and have a cached app list, skip straight + // to the app grid without a loading frame. This is the fast path that users + // should hit most. + if (host.online && host.pairState == PairStatePaired && host.appList.count > 0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self alreadyPaired]; + }); + return; + } + + [self showLoadingFrame]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ HttpManager* hMan = [[HttpManager alloc] initWithHost:host.activeAddress uniqueId:_uniqueId deviceName:deviceName cert:_cert]; ServerInfoResponse* serverInfoResp = [[ServerInfoResponse alloc] init];