mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-18 14:41:14 +00:00
Display a loading spinner while adding a PC is in progress
This commit is contained in:
@@ -536,14 +536,17 @@ static NSMutableSet* hostList;
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||
NSString* hostAddress = ((UITextField*)[[alertController textFields] objectAtIndex:0]).text;
|
||||
[self showLoadingFrame:^{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
||||
[self->_discMan discoverHost:hostAddress withCallback:^(TemporaryHost* host, NSString* error){
|
||||
if (host != nil) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hideLoadingFrame:^{
|
||||
@synchronized(hostList) {
|
||||
[hostList addObject:host];
|
||||
}
|
||||
[self updateHosts];
|
||||
}];
|
||||
});
|
||||
} else {
|
||||
unsigned int portTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443,
|
||||
@@ -556,10 +559,14 @@ static NSMutableSet* hostList;
|
||||
[Utils addHelpOptionToDialog:hostNotFoundAlert];
|
||||
[hostNotFoundAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self hideLoadingFrame:^{
|
||||
[[self activeViewController] presentViewController:hostNotFoundAlert animated:YES completion:nil];
|
||||
}];
|
||||
});
|
||||
}
|
||||
}];});
|
||||
}];
|
||||
});
|
||||
}];
|
||||
}]];
|
||||
[alertController addTextFieldWithConfigurationHandler:nil];
|
||||
[[self activeViewController] presentViewController:alertController animated:YES completion:nil];
|
||||
|
||||
Reference in New Issue
Block a user