From 49f647748c323631e4f033142cf4894245c74efd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 29 Aug 2018 07:52:33 -0700 Subject: [PATCH] Fix discovery being stopped after returning from Add PC dialog --- Limelight/ViewControllers/MainFrameViewController.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 2b2ae89..480aaa5 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -748,7 +748,7 @@ static NSMutableSet* hostList; #endif } --(void)beginForegroundRefresh +-(void)beginForegroundRefresh:(bool)refreshAppList { if (!_background) { // This will kick off box art caching @@ -757,7 +757,7 @@ static NSMutableSet* hostList; [_discMan startDiscovery]; // This will refresh the applist when a paired host is selected - if (_selectedHost != nil && _selectedHost.pairState == PairStatePaired) { + if (refreshAppList && _selectedHost != nil && _selectedHost.pairState == PairStatePaired) { [self hostClicked:_selectedHost view:nil]; } } @@ -767,7 +767,7 @@ static NSMutableSet* hostList; { _background = NO; - [self beginForegroundRefresh]; + [self beginForegroundRefresh: YES]; } -(void)handleEnterBackground @@ -823,9 +823,7 @@ static NSMutableSet* hostList; // loading frame which will cause an infinite loop by starting // another loading frame. To avoid this, just don't refresh // if we're coming back from a loading frame view. - if (![[self activeViewController] isKindOfClass:[LoadingFrameViewController class]]) { - [self beginForegroundRefresh]; - } + [self beginForegroundRefresh: ![[self activeViewController] isKindOfClass:[LoadingFrameViewController class]]]; } - (void)viewDidDisappear:(BOOL)animated