Skip to content

Commit

Permalink
Address QA findings.
Browse files Browse the repository at this point in the history
- Avoid displaying multi-informant/target subject banner UI.
  • Loading branch information
JustinNusca committed Oct 16, 2024
1 parent 492244f commit 3941a9f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/widgets/ActivityGroups/model/hooks/useTakeNowRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useMemo } from 'react';

import { openStoreLink } from '~/abstract/lib';
import { isSupportedActivity } from '~/entities/activity';
import { appletModel } from '~/entities/applet';
import { useStartSurvey } from '~/features/PassSurvey';
import { AppletBaseDTO, AppletEventsResponse, HydratedAssignmentDTO } from '~/shared/api';

Expand All @@ -22,7 +21,6 @@ export function useTakeNowRedirect({
publicAppletKey?: string | null;
}) {
const { startSurvey } = useStartSurvey({ applet, isPublic, publicAppletKey });
const { getMultiInformantState } = appletModel.hooks.useMultiInformantState();

const handleTakeNowRedirect = useMemo(
() =>
Expand All @@ -31,20 +29,18 @@ export function useTakeNowRedirect({
eventId,
flowId = null,
isSupported = true,
targetSubjectId = null,
}: {
activityId: string;
eventId: string;
flowId?: string | null;
isSupported?: boolean;
targetSubjectId?: string | null;
}) => {
if (!isSupported) {
openStoreLink();
return;
}

startSurvey({ activityId, eventId, flowId, shouldRestart: true, targetSubjectId });
startSurvey({ activityId, eventId, flowId, shouldRestart: true, targetSubjectId: null });
},
[startSurvey],
);
Expand All @@ -53,7 +49,6 @@ export function useTakeNowRedirect({
const activity = applet.activities.find(({ id }) => id === activityOrFlowId);
const flow = applet.activityFlows.find(({ id }) => id === activityOrFlowId);
const event = events.find(({ entityId }) => entityId === (activity?.id || flow?.id));
const { targetSubject } = getMultiInformantState();

if (!event) {
return;
Expand All @@ -64,7 +59,6 @@ export function useTakeNowRedirect({
activityId: activity.id,
isSupported: isSupportedActivity(activity.containsResponseTypes),
eventId: event.id,
targetSubjectId: targetSubject?.id,
});
}

Expand All @@ -80,7 +74,6 @@ export function useTakeNowRedirect({
),
eventId: event.id,
flowId: flow.id,
targetSubjectId: targetSubject?.id,
});
}
}
Expand Down

0 comments on commit 3941a9f

Please sign in to comment.