Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace emojis on mount(both the main composer and edit composer) #30301

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Loading