diff --git a/src/pages/home/report/ReportActionCompose/SilentCommentUpdater.js b/src/pages/home/report/ReportActionCompose/SilentCommentUpdater.js index 09f9d368bdcc..4347d6bde8b3 100644 --- a/src/pages/home/report/ReportActionCompose/SilentCommentUpdater.js +++ b/src/pages/home/report/ReportActionCompose/SilentCommentUpdater.js @@ -44,6 +44,11 @@ function SilentCommentUpdater({comment, commentRef, report, value, updateComment const {preferredLocale} = useLocalize(); const prevPreferredLocale = usePrevious(preferredLocale); + useEffect(() => { + updateComment(comment); + // eslint-disable-next-line react-hooks/exhaustive-deps -- We need to run this on mount + }, []); + useEffect(() => { // Value state does not have the same value as comment props when the comment gets changed from another tab. // In this case, we should synchronize the value between tabs. diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js index 4b73ce3b21db..8330aef5f23f 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.js +++ b/src/pages/home/report/ReportActionItemMessageEdit.js @@ -269,6 +269,11 @@ function ReportActionItemMessageEdit(props) { [props.action.message, debouncedSaveDraft, debouncedUpdateFrequentlyUsedEmojis, props.preferredSkinTone, preferredLocale], ); + useEffect(() => { + updateDraft(draft); + // eslint-disable-next-line react-hooks/exhaustive-deps -- run this only when language is changed + }, [props.action.reportActionID, preferredLocale]); + /** * Delete the draft of the comment being edited. This will take the comment out of "edit mode" with the old content. */