1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

fix: project settings selected tab bug (#6590)

https://linear.app/unleash/issue/2-2034/project-settings-url-bug

This prevents a bug where the wrong tab would show as selected, only
present in an edge case where the project has the name of a settings
tab.
This commit is contained in:
Nuno Góis 2024-03-18 14:02:29 +00:00 committed by GitHub
parent 53354224fc
commit 19ae9b5486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,7 +96,8 @@ export const ProjectSettings = () => {
tabs={tabs} tabs={tabs}
value={ value={
tabs.find( tabs.find(
({ id }) => id && location.pathname?.includes(`/${id}`), ({ id }) =>
id && location.pathname?.includes(`/settings/${id}`),
)?.id || tabs[0].id )?.id || tabs[0].id
} }
onChange={onChange} onChange={onChange}