Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track Python Panel closes #4922

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { 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,12 +30,14 @@
} = useCustomPanelHooks(props);
const pending = fos.useTimeout(PANEL_LOAD_TIMEOUT);
const setPanelCloseEffect = useSetPanelCloseEffect();
const trackEvent = useTrackEvent();

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

Check warning on line 40 in app/packages/operators/src/CustomPanel.tsx

View workflow job for this annotation

GitHub Actions / lint / eslint

React Hook useEffect has missing dependencies: 'panelId', 'panelName', 'setPanelCloseEffect', and 'trackEvent'. Either include them or remove the dependency array

useEffect(() => {
setLoading(count > 0);
Expand Down Expand Up @@ -98,7 +101,7 @@

useEffect(() => {
dimensions?.refresh();
}, []);

Check warning on line 104 in app/packages/operators/src/CustomPanel.tsx

View workflow job for this annotation

GitHub Actions / lint / eslint

React Hook useEffect has a missing dependency: 'dimensions'. Either include it or remove the dependency array

return children;
}
Expand Down
Loading