From 5fd2c29a73a1fe283fb890f179c51d9e372faf8a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 31 May 2018 01:36:10 -0700 Subject: [PATCH] Avoid displaying error dialogs on passive actions like returning to foreground --- Limelight/ViewControllers/MainFrameViewController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index ca9cc9a..eedfe85 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -302,7 +302,13 @@ static NSMutableSet* hostList; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting"]]; }]]; [applistAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:applistAlert animated:YES completion:nil]; + + if (view != nil) { + // Only display an alert if this was the result of a real + // user action, not just passively entering the foreground again + [self presentViewController:applistAlert animated:YES completion:nil]; + } + host.online = NO; [self showHostSelectionView]; });