fix: only fire event if dashboard actually opens (#97)

This commit is contained in:
Ben Warzeski
2022-12-15 10:53:04 -05:00
committed by GitHub
parent 875ecdbdb0
commit 81f1282cb0

View File

@@ -30,7 +30,11 @@ export const useEnterpriseDashboardHook = () => {
setShowModal(false);
};
React.useEffect(trackOpened, []);
React.useEffect(() => {
if (dashboard && dashboard.label) {
trackOpened();
}
}, []); // eslint-disable-line
return {
showModal,