From 132a1fc410c110645f229eb08b7d431c830e967d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 31 May 2018 01:53:09 -0700 Subject: [PATCH] Don't attempt to pair on entry to foreground if we've become unpaired --- Limelight/ViewControllers/MainFrameViewController.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 83d2b3bd..7a1e4145 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -317,13 +317,22 @@ static NSMutableSet* hostList; if ([[serverInfoResp getStringTag:@"PairStatus"] isEqualToString:@"1"]) { Log(LOG_I, @"Already Paired"); [self alreadyPaired]; - } else { + } + // Only pair when this was the result of explicit user action + else if (view != nil) { Log(LOG_I, @"Trying to pair"); // Polling the server while pairing causes the server to screw up [self->_discMan stopDiscoveryBlocking]; PairManager* pMan = [[PairManager alloc] initWithManager:hMan andCert:self->_cert callback:self]; [self->_opQueue addOperation:pMan]; } + else { + // Not user action, so just return to host screen + dispatch_async(dispatch_get_main_queue(), ^{ + [self hideLoadingFrame]; + [self showHostSelectionView]; + }); + } } }); }