Skip to content

Commit

Permalink
Merge pull request #44189 from bernhardoj/fix/42533-member-unselected…
Browse files Browse the repository at this point in the history
…-after-refresh

Fix member is unselected when refresh at workspace invite message page and go back
  • Loading branch information
roryabraham authored Jun 24, 2024
2 parents 569505e + fea92b5 commit 9e5181d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/workspace/WorkspaceInvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ function WorkspaceInvitePage({route, betas, invitedEmailsToAccountIDsDraft, poli
const excludedUsers = useMemo(() => PolicyUtils.getIneligibleInvitees(policy?.employeeList), [policy?.employeeList]);

useEffect(() => {
if (!areOptionsInitialized) {
return;
}

const newUsersToInviteDict: Record<number, OptionData> = {};
const newPersonalDetailsDict: Record<number, OptionData> = {};
const newSelectedOptionsDict: Record<number, MemberForList> = {};
Expand Down Expand Up @@ -154,7 +158,7 @@ function WorkspaceInvitePage({route, betas, invitedEmailsToAccountIDsDraft, poli
setSelectedOptions(Object.values(newSelectedOptionsDict));

// eslint-disable-next-line react-hooks/exhaustive-deps -- we don't want to recalculate when selectedOptions change
}, [options.personalDetails, policy?.employeeList, betas, debouncedSearchTerm, excludedUsers]);
}, [options.personalDetails, policy?.employeeList, betas, debouncedSearchTerm, excludedUsers, areOptionsInitialized]);

const sections: MembersSection[] = useMemo(() => {
const sectionsArr: MembersSection[] = [];
Expand Down

0 comments on commit 9e5181d

Please sign in to comment.