Skip to content

Commit

Permalink
update selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ashit-rath committed Nov 4, 2024
1 parent fba50e9 commit 4e2d9a8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/client/src/ce/sagas/analyticsSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { getCurrentPageId } from "selectors/editorSelectors";
import type { TriggerMeta } from "ee/sagas/ActionExecution/ActionExecutionSagas";
import { isArray } from "lodash";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { getAppMode, getJSCollection } from "ee/selectors/entitiesSelector";
import { getAllJSCollections, getAppMode } from "ee/selectors/entitiesSelector";
import type { AppState } from "ee/reducers";
import { getWidget } from "sagas/selectors";
import { getUserSource } from "ee/utils/AnalyticsUtil";
import { getCurrentApplication } from "ee/selectors/applicationSelectors";
import type { JSCollection } from "entities/JSCollection";
import type { JSCollectionData } from "ee/reducers/entityReducers/jsActionsReducer";

export interface UserAndAppDetails {
pageId: string;
Expand Down Expand Up @@ -73,10 +73,12 @@ export function* logDynamicTriggerExecution({
const widget: ReturnType<typeof getWidget> | undefined = yield select(
(state: AppState) => getWidget(state, triggerMeta.source?.id || ""),
);
const jsCollection: JSCollection | undefined = yield select(
getJSCollection,
triggerMeta?.source?.id || "",
const jsCollectionsData: JSCollectionData[] =
yield select(getAllJSCollections);
const jsCollectionData = (jsCollectionsData || []).find(
({ config }) => config.id === triggerMeta?.source?.id || "",
);
const jsCollection = jsCollectionData?.config;

const dynamicPropertyPathList = widget?.dynamicPropertyPathList;
const isJSToggled = !!dynamicPropertyPathList?.find(
Expand Down

0 comments on commit 4e2d9a8

Please sign in to comment.