1
0
Fork 0

Update list of tabs after onboarding screen was dismissed.

master
Sebastian Kaspari 2020-01-16 15:39:37 +01:00
parent 6b786ca8dc
commit 3a1292911d
2 changed files with 5 additions and 3 deletions

View File

@ -487,7 +487,9 @@ class HomeFragment : Fragment() {
private fun hideOnboarding() {
onboarding.finish()
homeFragmentStore.dispatch(
HomeFragmentAction.ModeChange(currentMode.getCurrentMode()))
HomeFragmentAction.ModeChange(
mode = currentMode.getCurrentMode(),
tabs = getListOfSessions().toTabs()))
}
private fun setupHomeMenu() {

View File

@ -57,7 +57,7 @@ sealed class HomeFragmentAction : Action {
HomeFragmentAction()
data class CollectionExpanded(val collection: TabCollection, val expand: Boolean) : HomeFragmentAction()
data class CollectionsChange(val collections: List<TabCollection>) : HomeFragmentAction()
data class ModeChange(val mode: Mode) : HomeFragmentAction()
data class ModeChange(val mode: Mode, val tabs: List<Tab> = emptyList()) : HomeFragmentAction()
data class TabsChange(val tabs: List<Tab>) : HomeFragmentAction()
}
@ -83,7 +83,7 @@ private fun homeFragmentStateReducer(
state.copy(expandedCollections = newExpandedCollection)
}
is HomeFragmentAction.CollectionsChange -> state.copy(collections = action.collections)
is HomeFragmentAction.ModeChange -> state.copy(mode = action.mode, tabs = emptyList())
is HomeFragmentAction.ModeChange -> state.copy(mode = action.mode, tabs = action.tabs)
is HomeFragmentAction.TabsChange -> state.copy(tabs = action.tabs)
}
}