Skip to content

Commit

Permalink
Merge pull request #4922 from voxel51/feat/track-panel-closes
Browse files Browse the repository at this point in the history
Track Python Panel closes
  • Loading branch information
Br2850 authored Oct 18, 2024
2 parents 7cf9d3c + 01764ea commit 9b17104
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/packages/operators/src/CustomPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { PANEL_LOAD_TIMEOUT } from "./constants";
import { useActivePanelEventsCount } from "./hooks";
import { Property } from "./types";
import { CustomPanelProps, useCustomPanelHooks } from "./useCustomPanelHooks";
import { useTrackEvent } from "@fiftyone/analytics";

export function CustomPanel(props: CustomPanelProps) {
const { panelId, dimensions, panelName, panelLabel } = props;
Expand All @@ -29,10 +30,12 @@ export function CustomPanel(props: CustomPanelProps) {
} = useCustomPanelHooks(props);
const pending = fos.useTimeout(PANEL_LOAD_TIMEOUT);
const setPanelCloseEffect = useSetPanelCloseEffect();
const trackEvent = useTrackEvent();

useEffect(() => {
setPanelCloseEffect(() => {
clearUseKeyStores(panelId);
trackEvent("close_panel", { panel: panelName });
});
}, []);

Expand Down

0 comments on commit 9b17104

Please sign in to comment.