fix: project members settings flickering (#3894)

This commit is contained in:
Lakhan Baheti 2024-03-07 13:26:58 +05:30 committed by GitHub
parent b535d8a23c
commit b03f6a81e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -49,14 +49,14 @@ export const MemberSelect: React.FC<Props> = observer((props) => {
<CustomSearchSelect <CustomSearchSelect
value={value} value={value}
label={ label={
<div className="flex items-center gap-2"> <div className="flex items-center gap-2 h-5">
{selectedOption && <Avatar name={selectedOption.member?.display_name} src={selectedOption.member?.avatar} />} {selectedOption && <Avatar name={selectedOption.member?.display_name} src={selectedOption.member?.avatar} />}
{selectedOption ? ( {selectedOption ? (
selectedOption.member?.display_name selectedOption.member?.display_name
) : ( ) : (
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Ban className="h-3.5 w-3.5 rotate-90 text-custom-sidebar-text-400" /> <Ban className="h-3.5 w-3.5 rotate-90 text-custom-sidebar-text-400" />
<span className="py-0.5 text-sm text-custom-sidebar-text-400">None</span> <span className="text-sm text-custom-sidebar-text-400">None</span>
</div> </div>
)} )}
</div> </div>

View File

@ -63,11 +63,14 @@ export const ProjectSettingsMemberDefaults: React.FC = observer(() => {
}); });
await updateProject(workspaceSlug.toString(), projectId.toString(), { await updateProject(workspaceSlug.toString(), projectId.toString(), {
default_assignee: formData.default_assignee === "none" ? null : formData.default_assignee, default_assignee:
project_lead: formData.project_lead === "none" ? null : formData.project_lead, formData.default_assignee === "none"
? null
: formData.default_assignee ?? currentProjectDetails?.default_assignee,
project_lead:
formData.project_lead === "none" ? null : formData.project_lead ?? currentProjectDetails?.project_lead,
}) })
.then(() => { .then(() => {
fetchProjectDetails(workspaceSlug.toString(), projectId.toString());
setToast({ setToast({
title: "Success", title: "Success",
type: TOAST_TYPE.SUCCESS, type: TOAST_TYPE.SUCCESS,