Remove the successful quit dialog since it's redundant and annoying

This commit is contained in:
Cameron Gutman
2019-09-14 13:08:47 -07:00
parent 202f968b98
commit 283e735f90
@@ -585,45 +585,39 @@ static NSMutableSet* hostList;
} }
[self->_discMan addHostToDiscovery:app.host]; [self->_discMan addHostToDiscovery:app.host];
UIAlertController* alert;
// If it fails, display an error and stop the current operation // If it fails, display an error and stop the current operation
if (quitResponse.statusCode != 200) { if (quitResponse.statusCode != 200) {
alert = [UIAlertController alertControllerWithTitle:@"Quitting App Failed" UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Quitting App Failed"
message:@"Failed to quit app. If this app was started by " message:@"Failed to quit app. If this app was started by "
"another device, you'll need to quit from that device." "another device, you'll need to quit from that device."
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
} [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
// If it succeeds and we're to start streaming, segue to the stream and return
else if (![app.id isEqualToString:currentApp.id]) {
app.host.currentGame = @"0";
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self updateAppsForHost:app.host]; [self updateAppsForHost:app.host];
[self prepareToStreamApp:app];
[self hideLoadingFrame: ^{ [self hideLoadingFrame: ^{
[self performSegueWithIdentifier:@"createStreamFrame" sender:nil]; [[self activeViewController] presentViewController:alert animated:YES completion:nil];
}]; }];
}); });
return;
} }
// Otherwise, display a dialog to notify the user that the app was quit
else { else {
app.host.currentGame = @"0"; app.host.currentGame = @"0";
dispatch_async(dispatch_get_main_queue(), ^{
// Refresh the UI
[self updateAppsForHost:app.host];
alert = [UIAlertController alertControllerWithTitle:@"Quitting App" // If it succeeds and we're to start streaming, segue to the stream
message:@"The app was quit successfully." if (![app.id isEqualToString:currentApp.id]) {
preferredStyle:UIAlertControllerStyleAlert]; [self prepareToStreamApp:app];
[self hideLoadingFrame: ^{
[self performSegueWithIdentifier:@"createStreamFrame" sender:nil];
}];
}
else {
// Otherwise, just hide the loading icon
[self hideLoadingFrame:nil];
}
});
} }
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
dispatch_async(dispatch_get_main_queue(), ^{
[self updateAppsForHost:app.host];
[self hideLoadingFrame: ^{
[[self activeViewController] presentViewController:alert animated:YES completion:nil];
}];
});
}); });
}]; }];