mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-04 15:06:06 +00:00
Refresh app and host state when returning from streaming via error
This commit is contained in:
@@ -656,16 +656,23 @@ static NSMutableSet* hostList;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
-(void)beginForegroundRefresh
|
||||
{
|
||||
if (!_background) {
|
||||
[_discMan startDiscovery];
|
||||
|
||||
// This will refresh the applist when a paired host is selected
|
||||
if (_selectedHost != nil && _selectedHost.pairState == PairStatePaired) {
|
||||
[self hostClicked:_selectedHost view:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)handleReturnToForeground
|
||||
{
|
||||
_background = NO;
|
||||
|
||||
[_discMan startDiscovery];
|
||||
|
||||
// This will refresh the applist when a paired host is selected
|
||||
if (_selectedHost != nil && _selectedHost.pairState == PairStatePaired) {
|
||||
[self hostClicked:_selectedHost view:nil];
|
||||
}
|
||||
[self beginForegroundRefresh];
|
||||
}
|
||||
|
||||
-(void)handleEnterBackground
|
||||
@@ -692,10 +699,14 @@ static NSMutableSet* hostList;
|
||||
// since the stream view segues to us just before
|
||||
// entering the background. We can't check the app
|
||||
// state here (since it's in transition), so we have
|
||||
// to use this variable that we set.
|
||||
if (!_background) {
|
||||
[_discMan startDiscovery];
|
||||
}
|
||||
// to use this function that will use our internal
|
||||
// state here to determine whether we're foreground.
|
||||
//
|
||||
// Note that this is neccessary here as we may enter
|
||||
// this view via an error dialog from the stream
|
||||
// view, so we won't get a return to active notification
|
||||
// for that which would normally fire beginForegroundRefresh.
|
||||
[self beginForegroundRefresh];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated
|
||||
|
||||
Reference in New Issue
Block a user