Skip to content

Commit

Permalink
update parent draft editor when saving draft from thread first chat
Browse files Browse the repository at this point in the history
  • Loading branch information
eh2077 committed Aug 16, 2023
1 parent cb40634 commit 0e4c5b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ function editReportComment(reportID, originalReportAction, textForNewComment) {
* Saves the draft for a comment report action. This will put the comment into "edit mode"
*
* @param {String} reportID
* @param {Number} reportAction
* @param {Object} reportAction
* @param {String} draftMessage
*/
function saveReportActionDraft(reportID, reportAction, draftMessage) {
Expand Down
7 changes: 7 additions & 0 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ function ReportActionItemMessageEdit(props) {
const isFocusedRef = useRef(false);
const insertedEmojis = useRef([]);

useEffect(() => {
if (props.draftMessage === props.action.message[0].html) {
return;
}
setDraft(Str.htmlDecode(props.draftMessage));
}, [props.draftMessage, props.action.message]);

useEffect(() => {
// required for keeping last state of isFocused variable
isFocusedRef.current = isFocused;
Expand Down

0 comments on commit 0e4c5b4

Please sign in to comment.