does not force return to host view after session connection

This commit is contained in:
TrueZhuanjia committed 2025-07-07 22:56:44 +08:00
1 parent 1f13fd691b
commit eacdda384a
1 file changed
+5 -2
@@ -68,6 +68,7 @@
NSArray* _sortedAppList; NSArray* _sortedAppList;
NSCache* _boxArtCache; NSCache* _boxArtCache;
bool _background; bool _background;
bool _enteredAppView;
UIView* menuSeparator; UIView* menuSeparator;
UIView* snapshot; UIView* snapshot;
SettingsViewController* settingsViewController; SettingsViewController* settingsViewController;
@@ -321,6 +322,7 @@ static NSMutableSet* hostList;
} }
- (void)switchToHostView { - (void)switchToHostView {
_enteredAppView = false;
#if TARGET_OS_TV #if TARGET_OS_TV
// Remove the menu button intercept to allow the app to exit // Remove the menu button intercept to allow the app to exit
// when at the host selection view. // when at the host selection view.
@@ -359,6 +361,7 @@ static NSMutableSet* hostList;
} }
- (void)switchToAppView{ - (void)switchToAppView{
_enteredAppView = true;
//_appManager = [[AppAssetManager alloc] initWithCallback:self]; //_appManager = [[AppAssetManager alloc] initWithCallback:self];
[self.collectionView setCollectionViewLayout:self.collectionViewLayout]; [self.collectionView setCollectionViewLayout:self.collectionViewLayout];
[self.collectionView reloadData]; //for new scroll host view reloading mechanism [self.collectionView reloadData]; //for new scroll host view reloading mechanism
@@ -391,7 +394,7 @@ static NSMutableSet* hostList;
_selectedHost = host; _selectedHost = host;
if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) { if (host.state == StateOnline && host.pairState == PairStatePaired && host.appList.count > 0) {
[self closeSettingViewAnimated:NO]; [self closeSettingViewAnimated:NO];
[self switchToAppView]; // [self switchToAppView];
[self updateAppsForHost:_selectedHost]; [self updateAppsForHost:_selectedHost];
[self prepareToStreamApp:_sortedAppList.firstObject]; [self prepareToStreamApp:_sortedAppList.firstObject];
[self performSegueWithIdentifier:@"createStreamFrame" sender:nil]; [self performSegueWithIdentifier:@"createStreamFrame" sender:nil];
@@ -1763,7 +1766,7 @@ static NSMutableSet* hostList;
[self.view addSubview:self.collectionView]; [self.view addSubview:self.collectionView];
[self initHostCollection]; [self initHostCollection];
[self switchToHostView]; if(!_enteredAppView) [self switchToHostView];
[self retrieveSavedHosts]; [self retrieveSavedHosts];