Skip to content

Commit d6bd90b

Browse files
committed
refetch features on dismiss health event
1 parent 330210a commit d6bd90b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/web/components/modals/CreateFlag.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,7 @@ const CreateFlag = class extends Component {
19341934
>
19351935
<FeatureHealthTabContent
19361936
projectId={projectFlag.project}
1937+
environmentId={this.props.environmentId}
19371938
/>
19381939
</TabItem>
19391940
)}

frontend/web/components/modals/FeatureHealthTabContent.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import {
1414
FeatureHealthEventReasonTextBlock,
1515
FeatureHealthEventReasonUrlBlock,
1616
} from 'common/types/responses'
17+
import AppActions from 'common/dispatcher/app-actions'
1718

1819
type FeatureHealthTabContentProps = {
1920
projectId: number
21+
environmentId: number
2022
}
2123

2224
const EventTextBlocks = ({
@@ -109,6 +111,7 @@ const EventURLBlocks = ({
109111
}
110112

111113
const FeatureHealthTabContent: React.FC<FeatureHealthTabContentProps> = ({
114+
environmentId,
112115
projectId,
113116
}) => {
114117
const { data: healthEvents, isLoading } = useGetHealthEventsQuery(
@@ -122,8 +125,10 @@ const FeatureHealthTabContent: React.FC<FeatureHealthTabContentProps> = ({
122125
useEffect(() => {
123126
if (isDismissed) {
124127
toast('Event dismissed')
128+
// Refetch features after dismissing the health event
129+
AppActions.refreshFeatures(projectId, environmentId)
125130
}
126-
}, [isDismissed])
131+
}, [isDismissed, projectId, environmentId])
127132

128133
useEffect(() => {
129134
if (dismissError) {

0 commit comments

Comments
 (0)