Pick clubs from the top three divisions, and stop the rail from crashing
Some checks failed
Build TV app / build (push) Failing after 2s
Some checks failed
Build TV app / build (push) Failing after 2s
The club shortcut now offers every club of the first three German divisions instead of two hard-coded ones. Up to three can be active at once; benjamin and tobiasb still start with Hansa and the VfB switched on. Also fixes a crash on the left jump out of the channel list: the jump targeted a FocusRequester bound to the selected rail row, and a row that is scrolled out of a LazyColumn is not composed, so requesting focus on it threw. Jumps are now attempted and fall back to normal focus movement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,14 +54,21 @@ class AppState(
|
||||
private fun loadEnabledTeams(): Set<String> {
|
||||
val stored = prefs.getStringSet("teams", null)
|
||||
if (stored != null) return stored.toSet()
|
||||
return setOfNotNull(dev.castarr.tv.data.TeamFilters.defaultKeyFor(auth.username))
|
||||
return dev.castarr.tv.data.TeamFilters.defaultKeysFor(auth.username).toSet()
|
||||
}
|
||||
|
||||
fun toggleTeam(key: String) {
|
||||
/** Returns false when the cap of [TeamFilters.MAX_ACTIVE] is reached. */
|
||||
fun toggleTeam(key: String): Boolean {
|
||||
if (key !in enabledTeams &&
|
||||
enabledTeams.size >= dev.castarr.tv.data.TeamFilters.MAX_ACTIVE
|
||||
) {
|
||||
return false
|
||||
}
|
||||
enabledTeams =
|
||||
if (key in enabledTeams) enabledTeams - key else enabledTeams + key
|
||||
prefs.edit().putStringSet("teams", enabledTeams).apply()
|
||||
if (activeTeam == key && key !in enabledTeams) activeTeam = null
|
||||
return true
|
||||
}
|
||||
var audioTracks by mutableStateOf<List<PlayerController.AudioTrack>>(emptyList())
|
||||
private set
|
||||
|
||||
Reference in New Issue
Block a user