Skip to content

Commit

Permalink
feat(help): disable pages aide in survey
Browse files Browse the repository at this point in the history
  • Loading branch information
lailabjil committed Nov 21, 2023
1 parent e04e7a2 commit d6acb65
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions src/pages/home-surveyed/HomeSurveyed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ const HomeSurveyedPage = () => {

const navWorkTime = useCallback(
(idSurvey: string) => () => {
const firstName = getValue(idSurvey, FieldNameEnum.FIRSTNAME);
let data = getData(idSurvey || "");

localStorage.setItem(LocalStorageVariableEnum.IS_GLOBAL, "false");
Expand All @@ -173,16 +172,11 @@ const HomeSurveyedPage = () => {
rightsSurvey: getSurveyRights(idSurvey ?? ""),
};
setEnviro(context, navigate, callbackHolder);

if (firstName != null || isDemo) {
return navToWeeklyPlannerOrClose(
idSurvey,
navigate,
getSource(SourcesEnum.WORK_TIME_SURVEY),
);
} else {
return navigate(getNavigatePath(EdtRoutesNameEnum.HELP_WORK_TIME));
}
return navToWeeklyPlannerOrClose(
idSurvey,
navigate,
getSource(SourcesEnum.WORK_TIME_SURVEY),
);
},
[],
);
Expand Down Expand Up @@ -211,17 +205,12 @@ const HomeSurveyedPage = () => {
localStorage.setItem(LocalStorageVariableEnum.IDSURVEY_CURRENT, idSurvey);

setEnviro(context, navigate, callbackHolder);
const firstName = getValue(idSurvey, FieldNameEnum.FIRSTNAME);
if (firstName != null || isDemo) {
navToActivityOrPlannerOrSummary(
idSurvey,
getSource(SourcesEnum.ACTIVITY_SURVEY).maxPage,
navigate,
getSource(SourcesEnum.ACTIVITY_SURVEY),
);
} else {
return navigate(getNavigatePath(EdtRoutesNameEnum.HELP_ACTIVITY));
}
navToActivityOrPlannerOrSummary(
idSurvey,
getSource(SourcesEnum.ACTIVITY_SURVEY).maxPage,
navigate,
getSource(SourcesEnum.ACTIVITY_SURVEY),
);
},
[],
);
Expand Down

0 comments on commit d6acb65

Please sign in to comment.