Fixed crash when last tab selected was an empty tab
This commit is contained in:
parent
3a45d40d66
commit
fbe1dd3d9e
@ -43,8 +43,8 @@ class TabsManager @Inject constructor(
|
|||||||
val latestSelectedTabIndex = appSettingsRepository.latestRepositoryTabSelected
|
val latestSelectedTabIndex = appSettingsRepository.latestRepositoryTabSelected
|
||||||
|
|
||||||
_currentTab.value = when(latestSelectedTabIndex < 0) {
|
_currentTab.value = when(latestSelectedTabIndex < 0) {
|
||||||
true -> _tabsFlow.value.first()
|
true -> tabsFlow.value.first()
|
||||||
false -> tabsFlow.value[latestSelectedTabIndex]
|
false -> tabsFlow.value.getOrNull(latestSelectedTabIndex) ?: tabsFlow.value.first()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user