Skip to content

Commit

Permalink
fix: feature panel url updating url when opening (#5159)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoapolo authored Feb 25, 2025
1 parent e4f2a49 commit 4657071
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions frontend/web/components/FeatureRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ const FeatureRow: FC<FeatureRowProps> = ({
const { feature } = Utils.fromParam()
const { id } = projectFlag

if (`${id}` === feature) {
const isModalOpen = !!document?.getElementsByClassName(
'create-feature-modal',
)?.length
if (`${id}` === feature && !isModalOpen) {
editFeature(projectFlag, environmentFlags?.[id])
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -145,11 +148,10 @@ const FeatureRow: FC<FeatureRowProps> = ({
API.trackEvent(Constants.events.VIEW_FEATURE)
const tabValue = tab || Utils.fromParam().tab || 'value'

history.replace(
{},
'',
`${document.location.pathname}?feature=${projectFlag.id}&tab=${tabValue}`,
)
history.replace({
pathname: document.location.pathname,
search: `?feature=${projectFlag.id}&tab=${tabValue}`,
})

openModal(
<Row>
Expand Down Expand Up @@ -177,7 +179,10 @@ const FeatureRow: FC<FeatureRowProps> = ({
/>,
'side-modal create-feature-modal',
() => {
history.replace({}, '', `${document.location.pathname}`)
history.replace({
pathname: document.location.pathname,
search: '',
})
},
)
}
Expand Down

0 comments on commit 4657071

Please sign in to comment.