chore: clear custom attributes on modal close

This commit is contained in:
Aaryan Khandelwal 2023-09-19 17:53:16 +05:30
parent 121d4cb4eb
commit 3b682c2124
2 changed files with 5 additions and 3 deletions

View File

@ -118,6 +118,8 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer(
}; };
const onClose = () => { const onClose = () => {
setCustomAttributesList({});
if (!showConfirmDiscard) handleClose(); if (!showConfirmDiscard) handleClose();
if (formDirtyState === null) return setActiveProject(null); if (formDirtyState === null) return setActiveProject(null);
const data = JSON.stringify(formDirtyState); const data = JSON.stringify(formDirtyState);
@ -125,6 +127,8 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer(
}; };
const onDiscardClose = () => { const onDiscardClose = () => {
setCustomAttributesList({});
if (formDirtyState !== null) { if (formDirtyState !== null) {
setShowConfirmDiscard(true); setShowConfirmDiscard(true);
} else { } else {

View File

@ -21,9 +21,7 @@ export interface SidebarProps {
} }
const Sidebar: React.FC<SidebarProps> = observer(({ toggleSidebar, setToggleSidebar }) => { const Sidebar: React.FC<SidebarProps> = observer(({ toggleSidebar, setToggleSidebar }) => {
const store: any = useMobxStore(); const store = useMobxStore();
// theme
const { collapsed: sidebarCollapse } = useTheme();
return ( return (
<div <div