Only show prev opened notif setting section

This commit is contained in:
Ian Philips 2022-09-14 17:25:17 -06:00
parent 3efd968058
commit 9aa56dd193

View File

@ -241,14 +241,12 @@ export function NotificationSettings(props: {
const { label, subscriptionTypes } = data
const expand =
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)
// due to a private user settings change. Just going to persist expanded state here
const [expanded, setExpanded] = usePersistentState(expand ?? false, {
key:
'NotificationsSettingsSection-' +
Object.keys(subscriptionTypes).join('-'),
key: 'NotificationsSettingsSection-' + subscriptionTypes.join('-'),
store: storageStore(safeLocalStorage()),
})