diff --git a/web/components/views/modal.tsx b/web/components/views/modal.tsx index dee435a06..50015d9e1 100644 --- a/web/components/views/modal.tsx +++ b/web/components/views/modal.tsx @@ -28,7 +28,7 @@ export const CreateUpdateProjectViewModal: FC = observer((props) => { const { cycleId, moduleId, viewId } = router.query; // store hooks const { createView, updateView } = useProjectView(); - const { captureEvent, trackElement } = useEventTracker(); + const { captureEvent, getTrackElement } = useEventTracker(); // toast alert const { setToastAlert } = useToast(); @@ -44,8 +44,8 @@ export const CreateUpdateProjectViewModal: FC = observer((props) => { view_id: res.id, filters: res.filters, element_id: cycleId ?? moduleId ?? viewId ?? projectId, - element: trackElement - ? trackElement + element: getTrackElement + ? getTrackElement : cycleId ? "Cycle issues page" : moduleId diff --git a/web/store/event-tracker.store.ts b/web/store/event-tracker.store.ts index f277d5495..6cce46224 100644 --- a/web/store/event-tracker.store.ts +++ b/web/store/event-tracker.store.ts @@ -24,6 +24,7 @@ export interface IEventTrackerStore { trackElement: string | undefined; // computed getRequiredProperties: any; + getTrackElement: string | undefined; // actions resetSession: () => void; setTrackElement: (element: string) => void; @@ -47,6 +48,7 @@ export class EventTrackerStore implements IEventTrackerStore { trackElement: observable, // computed getRequiredProperties: computed, + getTrackElement: computed, // actions resetSession: action, setTrackElement: action, @@ -58,6 +60,13 @@ export class EventTrackerStore implements IEventTrackerStore { this.rootStore = _rootStore; } + /** + * @description: Returns the current track element. + */ + get getTrackElement() { + return this.trackElement; + } + /** * @description: Returns the necessary property for the event tracking */