Skip to content

Commit

Permalink
fix: move here text inside auto complete suggester
Browse files Browse the repository at this point in the history
  • Loading branch information
allroundexperts committed May 23, 2023
1 parent 1b91882 commit 3334ef5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,6 @@ const CONST = {
SMALL_CONTAINER_HEIGHT_FACTOR: 2.5,
MIN_AMOUNT_OF_ITEMS: 3,
MAX_AMOUNT_OF_ITEMS: 5,
},
MENTION_SUGGESTER: {
HERE_TEXT: '@here',
},
COMPOSER_MAX_HEIGHT: 125,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ class ReportActionCompose extends React.Component {
getMentionOptions(personalDetails, searchValue = '') {
const suggestions = [];

if (CONST.MENTION_SUGGESTER.HERE_TEXT.includes(searchValue)) {
if (CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT.includes(searchValue)) {
suggestions.push({
text: CONST.MENTION_SUGGESTER.HERE_TEXT,
text: CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT,
alternateText: this.props.translate('mentionSuggestions.hereAlternateText'),
icons: [
{
Expand Down Expand Up @@ -636,7 +636,7 @@ class ReportActionCompose extends React.Component {
insertSelectedMention(highlightedMentionIndex) {
const commentBeforeAtSign = this.state.value.slice(0, this.state.atSignIndex);
const mentionObject = this.state.suggestedMentions[highlightedMentionIndex];
const mentionCode = mentionObject.text === CONST.MENTION_SUGGESTER.HERE_TEXT ? CONST.MENTION_SUGGESTER.HERE_TEXT : `@${mentionObject.alternateText}`;
const mentionCode = mentionObject.text === CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT ? CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT : `@${mentionObject.alternateText}`;
const commentAfterAtSignWithMentionRemoved = this.state.value.slice(this.state.atSignIndex).replace(CONST.REGEX.MENTION_REPLACER, '');

this.updateComment(`${commentBeforeAtSign}${mentionCode} ${commentAfterAtSignWithMentionRemoved}`, true);
Expand Down

0 comments on commit 3334ef5

Please sign in to comment.