mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: debounce logic in issue detail and description
This commit is contained in:
parent
01874cb2db
commit
fffcb2d947
@ -102,9 +102,13 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {
|
||||
});
|
||||
}, [issue, reset]);
|
||||
|
||||
const debouncedFormSave = debounce(async () => {
|
||||
// ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS
|
||||
const debouncedFormSave = useCallback(
|
||||
debounce(async () => {
|
||||
handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted"));
|
||||
}, 1500);
|
||||
}, 1500),
|
||||
[handleSubmit]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
|
@ -96,9 +96,13 @@ export const PeekOverviewIssueDetails: FC<IPeekOverviewIssueDetails> = (props) =
|
||||
}
|
||||
}, [issue.id]);
|
||||
|
||||
const debouncedFormSave = debounce(async () => {
|
||||
// ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS
|
||||
const debouncedFormSave = useCallback(
|
||||
debounce(async () => {
|
||||
handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting("submitted"));
|
||||
}, 1500);
|
||||
}, 1500),
|
||||
[handleSubmit]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isSubmitting === "submitted") {
|
||||
|
Loading…
Reference in New Issue
Block a user