forked from github/plane
fix: handled inital empty state close in the issue create/edit odal (#4033)
This commit is contained in:
parent
baab6ce99f
commit
60aea62739
@ -53,7 +53,7 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
||||
Object.entries(changesMade).forEach(([key, value]) => {
|
||||
const issueKey = key as keyof TIssue;
|
||||
if (value === null || value === undefined || value === "") delete changesMade[issueKey];
|
||||
if (typeof value === "object" && !value) delete changesMade[issueKey];
|
||||
if (typeof value === "object" && isEmpty(value)) delete changesMade[issueKey];
|
||||
if (Array.isArray(value) && value.length === 0) delete changesMade[issueKey];
|
||||
if (issueKey === "project_id") delete changesMade.project_id;
|
||||
if (issueKey === "priority" && value && value === "none") delete changesMade.priority;
|
||||
@ -64,8 +64,13 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
||||
)
|
||||
delete changesMade.description_html;
|
||||
});
|
||||
if (isEmpty(changesMade)) onClose(false);
|
||||
else setIssueDiscardModal(true);
|
||||
if (isEmpty(changesMade)) {
|
||||
onClose(false);
|
||||
setIssueDiscardModal(false);
|
||||
} else setIssueDiscardModal(true);
|
||||
} else {
|
||||
onClose(false);
|
||||
setIssueDiscardModal(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user