fix: bottom navigation bar customization not reflected in NavigationBar (Issue #37)
fix: bottom navigation bar customization not reflected in NavigationBar (Issue #37)
This commit is contained in:
1 file changed
+7
-2
@@ -178,8 +178,13 @@ fun MainNavigation() {
|
|||||||
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
|
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
|
||||||
// Read dynamic bottom-nav config
|
// Read dynamic bottom-nav config.
|
||||||
val bottomNavItems = remember { resolveBottomNavItems(AuthManager.getBottomNavItems()) }
|
// NB: deliberately NOT wrapped in remember { … } — AuthManager values change
|
||||||
|
// when the user customises items in Settings (saved to SharedPreferences).
|
||||||
|
// Without a key that tracks prefs changes, remember would cache the stale
|
||||||
|
// defaults and the NavigationBar would never reflect the user's picks.
|
||||||
|
// Reading fresh on every recomposition is negligible (pure map over 18 items).
|
||||||
|
val bottomNavItems = resolveBottomNavItems(AuthManager.getBottomNavItems())
|
||||||
val bottomNavKeys = remember(bottomNavItems) { bottomNavItems.map { it.key }.toSet() }
|
val bottomNavKeys = remember(bottomNavItems) { bottomNavItems.map { it.key }.toSet() }
|
||||||
|
|
||||||
// Sync primary screens to NavigationController
|
// Sync primary screens to NavigationController
|
||||||
|
|||||||
Reference in new issue
Block a user