Only show prev opened notif setting section
This commit is contained in:
		
							parent
							
								
									3efd968058
								
							
						
					
					
						commit
						9aa56dd193
					
				|  | @ -241,14 +241,12 @@ export function NotificationSettings(props: { | ||||||
|     const { label, subscriptionTypes } = data |     const { label, subscriptionTypes } = data | ||||||
|     const expand = |     const expand = | ||||||
|       navigateToSection && |       navigateToSection && | ||||||
|       Object.keys(subscriptionTypes).includes(navigateToSection) |       subscriptionTypes.includes(navigateToSection as notification_preference) | ||||||
| 
 | 
 | ||||||
|     // Not sure how to prevent re-render (and collapse of an open section)
 |     // Not sure how to prevent re-render (and collapse of an open section)
 | ||||||
|     // due to a private user settings change. Just going to persist expanded state here
 |     // due to a private user settings change. Just going to persist expanded state here
 | ||||||
|     const [expanded, setExpanded] = usePersistentState(expand ?? false, { |     const [expanded, setExpanded] = usePersistentState(expand ?? false, { | ||||||
|       key: |       key: 'NotificationsSettingsSection-' + subscriptionTypes.join('-'), | ||||||
|         'NotificationsSettingsSection-' + |  | ||||||
|         Object.keys(subscriptionTypes).join('-'), |  | ||||||
|       store: storageStore(safeLocalStorage()), |       store: storageStore(safeLocalStorage()), | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user