Skip to content

Commit

Permalink
avoid duplicating context
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme committed Oct 3, 2024
1 parent 16ac871 commit 7c13eba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export function useScreenContext() {
const { investigation } = useInvestigation();
const alertOriginInvestigation = alertOriginSchema.safeParse(investigation?.origin);
const alertId = alertOriginInvestigation.success ? alertOriginInvestigation.data.id : undefined;
const { data: alertDetails } = useFetchAlert({ id: alertId });
const { data: alertDetails, isLoading: isAlertDetailsLoading } = useFetchAlert({ id: alertId });

useEffect(() => {
if (!investigation) {
if (!investigation || isAlertDetailsLoading) {
return;
}

Expand All @@ -53,7 +53,7 @@ export function useScreenContext() {
},
],
});
}, [observabilityAIAssistant, investigation, alertDetails]);
}, [observabilityAIAssistant, investigation, alertDetails, isAlertDetailsLoading]);
}

function getAlertDetailScreenContext(alertDetail: EcsFieldsResponse) {
Expand Down

0 comments on commit 7c13eba

Please sign in to comment.