diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -51,9 +51,10 @@ import { useSelector } from '../redux/redux-utils'; import { nonThreadCalendarQuery } from '../selectors/nav-selectors'; import SWMansionIcon from '../SWMansionIcon.react'; -import { typeaheadRegex } from '../utils/typeahead-utils'; +import { webTypeaheadRegex } from '../utils/typeahead-utils'; import css from './chat-input-bar.css'; import TypeaheadTooltip from './typeahead-tooltip.react'; + type BaseProps = { +threadInfo: ThreadInfo, +inputState: InputState, @@ -534,7 +535,7 @@ () => inputSliceEndingAtCursor.length === props.inputState.draft.length || /\s/.test(props.inputState.draft[props.inputState.textCursorPosition]) - ? inputSliceEndingAtCursor.match(typeaheadRegex) + ? inputSliceEndingAtCursor.match(webTypeaheadRegex) : null, [ inputSliceEndingAtCursor, diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js --- a/web/utils/typeahead-utils.js +++ b/web/utils/typeahead-utils.js @@ -9,7 +9,7 @@ import { typeaheadStyle } from '../chat/chat-constants'; import { type InputState } from '../input/input-state'; -const typeaheadRegex: RegExp = new RegExp( +const webTypeaheadRegex: RegExp = new RegExp( `(?(?:^(?:.|\n)*\\s+)|^)@(?${oldValidUsernameRegexString})?$`, ); @@ -136,7 +136,7 @@ } export { - typeaheadRegex, + webTypeaheadRegex, getCaretOffsets, getTypeaheadTooltipActions, getTypeaheadTooltipPosition,