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/27362: Draft icon show even there is not anything #28574

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
11 changes: 0 additions & 11 deletions src/libs/ComposerUtils/debouncedSaveReportComment.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import * as User from '../../../../libs/actions/User';
import * as ReportUtils from '../../../../libs/ReportUtils';
import * as ReportActionsUtils from '../../../../libs/ReportActionsUtils';
import canFocusInputOnScreenFocus from '../../../../libs/canFocusInputOnScreenFocus';
import debouncedSaveReportComment from '../../../../libs/ComposerUtils/debouncedSaveReportComment';
DylanDylann marked this conversation as resolved.
Show resolved Hide resolved
import SilentCommentUpdater from './SilentCommentUpdater';
import Suggestions from './Suggestions';
import getDraftComment from '../../../../libs/ComposerUtils/getDraftComment';
Expand Down Expand Up @@ -187,6 +186,14 @@ function ComposerWithSuggestions({
RNTextInputReset.resetKeyboardInput(findNodeHandle(textInputRef.current));
}, [textInputRef]);

const debouncedSaveReportComment = useMemo(
DylanDylann marked this conversation as resolved.
Show resolved Hide resolved
() =>
_.debounce((selectedReportID, newComment) => {
Report.saveReportComment(selectedReportID, newComment || '');
}, 1000),
[],
);

/**
* Update the value of the comment in Onyx
*
Expand Down Expand Up @@ -238,7 +245,16 @@ function ComposerWithSuggestions({
debouncedBroadcastUserIsTyping(reportID);
}
},
[debouncedUpdateFrequentlyUsedEmojis, preferredLocale, preferredSkinTone, reportID, setIsCommentEmpty, suggestionsRef, raiseIsScrollLikelyLayoutTriggered],
[
debouncedUpdateFrequentlyUsedEmojis,
preferredLocale,
preferredSkinTone,
reportID,
setIsCommentEmpty,
suggestionsRef,
raiseIsScrollLikelyLayoutTriggered,
debouncedSaveReportComment,
],
);

/**
Expand Down Expand Up @@ -279,7 +295,7 @@ function ComposerWithSuggestions({
}
setIsFullComposerAvailable(false);
return trimmedComment;
}, [updateComment, setTextInputShouldClear, isComposerFullSize, setIsFullComposerAvailable, reportID]);
}, [updateComment, setTextInputShouldClear, isComposerFullSize, setIsFullComposerAvailable, reportID, debouncedSaveReportComment]);

/**
* Callback to add whatever text is chosen into the main input (used f.e as callback for the emoji picker)
Expand Down
Loading