Skip to content

Commit

Permalink
fix(user-profile): condition for advice seekers
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Aug 16, 2024
1 parent c30391a commit 78c5614
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ export const Profile = () => {
useEffect(() => {
// First agency can be set as only one session per asker is possible
// isSubsequentRegistrationAllowed false on consultingType
const specAgency = Object.values(userData.consultingTypes).filter(
(resort: any) =>
resort.isRegistered && resort.agency ? resort : null
);
setSpecificAgency(specAgency[0].agency);
if (!hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData)) {
const specAgency = Object.values(userData.consultingTypes)?.filter(
(resort: any) =>
resort.isRegistered && resort.agency ? resort : null
);
setSpecificAgency(specAgency[0].agency);
}
}, [setSpecificAgency, userData]);

useEffect(() => {
Expand Down

0 comments on commit 78c5614

Please sign in to comment.