mirror of
https://github.com/YTLitePlus/YTLitePlus.git
synced 2026-03-11 21:26:05 +00:00
Fix crash caused by edge case
This commit is contained in:
parent
bed3d1571f
commit
3c63594fc6
1 changed files with 6 additions and 1 deletions
|
|
@ -324,7 +324,12 @@ static const NSInteger YTLiteSection = 789; // Grabbed from YTLite
|
|||
return YES;
|
||||
}],
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"PLAYBACK_IN_FEEDS") pickerSectionTitle:nil rows:rows selectedItemIndex:(GetSelection(@"inline_muted_playback_enabled") - 1) parentResponder:[self parentResponder]];
|
||||
// It seems values greater than 3 act the same as Always On (Index 1)
|
||||
int (^getInlineSelection)() = ^int() {
|
||||
int selection = GetSelection(@"inline_muted_playback_enabled") - 1;
|
||||
return selection > 3 ? 1 : selection;
|
||||
};
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"PLAYBACK_IN_FEEDS") pickerSectionTitle:nil rows:rows selectedItemIndex:getInlineSelection() parentResponder:[self parentResponder]];
|
||||
[settingsViewController pushViewController:picker];
|
||||
return YES;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue