Skip to content

Commit

Permalink
fix edit message draft reappearing
Browse files Browse the repository at this point in the history
  • Loading branch information
roitman-g committed Mar 26, 2024
1 parent f7a697a commit feb5df2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionItemMessageEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ function ReportActionItemMessageEdit(
}, 1000),
[reportID, action],
);

useEffect(() => () => debouncedSaveDraft.cancel())

/**
* Update frequently used emojis list. We debounce this method in the constructor so that UpdateFrequentlyUsedEmojis
Expand Down Expand Up @@ -280,7 +282,6 @@ function ReportActionItemMessageEdit(
* Delete the draft of the comment being edited. This will take the comment out of "edit mode" with the old content.
*/
const deleteDraft = useCallback(() => {
debouncedSaveDraft.cancel();
Report.deleteReportActionDraft(reportID, action);

if (isActive()) {
Expand Down

0 comments on commit feb5df2

Please sign in to comment.