diff --git a/frontend/web/components/FeatureRow.tsx b/frontend/web/components/FeatureRow.tsx index ccffd86c2693..216764e1a61d 100644 --- a/frontend/web/components/FeatureRow.tsx +++ b/frontend/web/components/FeatureRow.tsx @@ -80,7 +80,10 @@ const FeatureRow: FC = ({ 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 @@ -145,11 +148,10 @@ const FeatureRow: FC = ({ 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( @@ -177,7 +179,10 @@ const FeatureRow: FC = ({ />, 'side-modal create-feature-modal', () => { - history.replace({}, '', `${document.location.pathname}`) + history.replace({ + pathname: document.location.pathname, + search: '', + }) }, ) }