fix: issue delete redirection, chore: code refactor (#1521)

This commit is contained in:
Anmol Singh Bhatia 2023-07-13 19:00:43 +05:30 committed by GitHub
parent 60e96bcb72
commit 7361657660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 24 deletions

View file

@ -88,13 +88,11 @@ export const AutoCloseAutomation: React.FC<Props> = ({ projectDetails, handleCha
</div>
<ToggleSwitch
value={projectDetails?.close_in !== 0}
onChange={() => {
if (projectDetails?.close_in === 0) {
handleChange({ close_in: 1, default_state: defaultState });
} else {
handleChange({ close_in: 0, default_state: null });
}
}}
onChange={() =>
projectDetails?.close_in === 0
? handleChange({ close_in: 1, default_state: defaultState })
: handleChange({ close_in: 0, default_state: null })
}
size="sm"
/>
</div>