- added nped category options for alert popups
- minor fix on modal for 'DISABLED' MCC
This commit is contained in:
@@ -12,17 +12,39 @@ export const IntegrationsProvider = ({ children }: IntegrationsProviderType) =>
|
||||
const { mutation } = useCameraBlackboard();
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const result = await mutation.mutateAsync({
|
||||
operation: "VIEW",
|
||||
path: "sessionStats",
|
||||
});
|
||||
if (!result.result || typeof result.result === "string") return;
|
||||
let isMounted = true;
|
||||
|
||||
dispatch({ type: "UPDATE", payload: result?.result });
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const result = await mutation.mutateAsync({
|
||||
operation: "VIEW",
|
||||
path: "sessionStats",
|
||||
});
|
||||
|
||||
if (!isMounted) return;
|
||||
|
||||
const catResult = await mutation.mutateAsync({
|
||||
operation: "VIEW",
|
||||
path: "CategoryPopup",
|
||||
});
|
||||
|
||||
if (!isMounted) return;
|
||||
if (!result?.result || typeof result.result === "string") return;
|
||||
|
||||
dispatch({ type: "UPDATE", payload: result.result });
|
||||
dispatch({ type: "NPEDCATENABLED", payload: catResult.result });
|
||||
} catch (error) {
|
||||
console.error("Error in fetchData:", error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchData();
|
||||
|
||||
return () => {
|
||||
isMounted = false;
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<IntegrationsContext.Provider
|
||||
value={{
|
||||
|
||||
Reference in New Issue
Block a user