Skip to content

Commit

Permalink
Merge pull request #375 from hotosm/fix/regulator-lock-task
Browse files Browse the repository at this point in the history
fix: disable popup trigger if user signin as `ReGULATOR`
  • Loading branch information
subashtiwari1010 authored Dec 2, 2024
2 parents 36d781d + a86574a commit 90bd93b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ const MapSection = ({ projectData }: { projectData: Record<string, any> }) => {
const taskClickedOnTable = useTypedSelector(
state => state.project.taskClickedOnTable,
);

const { data: taskStates } = useGetTaskStatesQuery(id as string, {
enabled: !!tasksData,
});
const signedInAs = localStorage.getItem('signedInAs');

const { mutate: lockTask } = useMutation<any, any, any, unknown>({
mutationFn: postTaskStatus,
Expand Down Expand Up @@ -267,8 +267,9 @@ const MapSection = ({ projectData }: { projectData: Record<string, any> }) => {
feature?.source?.includes('tasks-layer') &&
!(
(
userDetails?.role?.length === 1 &&
userDetails?.role?.includes('REGULATOR')
(userDetails?.role?.length === 1 &&
userDetails?.role?.includes('REGULATOR')) ||
signedInAs === 'REGULATOR'
) // Don't show popup if user role is regulator any and no other roles
)
);
Expand Down

0 comments on commit 90bd93b

Please sign in to comment.