Page MenuHomePhorge

D6557.1767055282.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D6557.1767055282.diff

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
@@ -23,7 +23,10 @@
threadActualMembers,
checkIfDefaultMembersAreVoiced,
} from 'lib/shared/thread-utils';
-import { getTypeaheadUserSuggestions } from 'lib/shared/typeahead-utils';
+import {
+ getTypeaheadUserSuggestions,
+ getTypeaheadRegexMatches,
+} from 'lib/shared/typeahead-utils';
import type { TypeaheadMatchedStrings } from 'lib/shared/typeahead-utils';
import type { CalendarQuery } from 'lib/types/entry-types';
import type { LoadingStatus } from 'lib/types/loading-types';
@@ -555,23 +558,17 @@
relativeMemberInfoSelectorForMembersOfThread(props.threadInfo.id),
);
- const inputSliceEndingAtCursor = React.useMemo(
- () =>
- props.inputState.draft.slice(0, props.inputState.textCursorPosition),
- [props.inputState.draft, props.inputState.textCursorPosition],
- );
- // we only try to match if there is end of text or whitespace after cursor
const typeaheadRegexMatches = React.useMemo(
() =>
- inputSliceEndingAtCursor.length === props.inputState.draft.length ||
- /\s/.test(props.inputState.draft[props.inputState.textCursorPosition])
- ? inputSliceEndingAtCursor.match(webTypeaheadRegex)
- : null,
- [
- inputSliceEndingAtCursor,
- props.inputState.textCursorPosition,
- props.inputState.draft,
- ],
+ getTypeaheadRegexMatches(
+ props.inputState.draft,
+ {
+ start: props.inputState.textCursorPosition,
+ end: props.inputState.textCursorPosition,
+ },
+ webTypeaheadRegex,
+ ),
+ [props.inputState.textCursorPosition, props.inputState.draft],
);
const typeaheadMatchedStrings: ?TypeaheadMatchedStrings = React.useMemo(

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 30, 12:41 AM (10 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866146
Default Alt Text
D6557.1767055282.diff (1 KB)

Event Timeline