diff --git a/web/components/issues/issue-layouts/properties/assignee.tsx b/web/components/issues/issue-layouts/properties/assignee.tsx index ee545f3a5..b436e274f 100644 --- a/web/components/issues/issue-layouts/properties/assignee.tsx +++ b/web/components/issues/issue-layouts/properties/assignee.tsx @@ -47,11 +47,17 @@ export const IssuePropertyAssignee: React.FC = observer( const [referenceElement, setReferenceElement] = useState(null); const [popperElement, setPopperElement] = useState(null); + const [isLoading, setIsLoading] = useState(false); const projectMembers = projectId ? projectStore?.members?.[projectId] : undefined; - const fetchProjectMembers = () => - workspaceSlug && projectId && projectStore.fetchProjectMembers(workspaceSlug, projectId); + const fetchProjectMembers = () => { + setIsLoading(true); + if (workspaceSlug && projectId) + workspaceSlug && + projectId && + projectStore.fetchProjectMembers(workspaceSlug, projectId).then(() => setIsLoading(false)); + }; const options = (projectMembers ?? [])?.map((member) => ({ value: member.member.id, @@ -128,7 +134,7 @@ export const IssuePropertyAssignee: React.FC = observer( className={`flex items-center justify-between gap-1 w-full text-xs ${ disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80" } ${buttonClassName}`} - onClick={() => fetchProjectMembers()} + onClick={() => !projectMembers && fetchProjectMembers()} > {label} {!hideDropdownArrow && !disabled &&