You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Fix emoting with emoji or pills (#8105)
* Fix emoting with emoji or pills * Fix some slash command errors not being shown * Re-enable mistakenly skipped SendMessageComposer tests * Test emoting with non-text parts
This commit is contained in:
@ -181,7 +181,9 @@ export function textSerialize(model: EditorModel): string {
|
||||
}
|
||||
|
||||
export function containsEmote(model: EditorModel): boolean {
|
||||
return startsWith(model, "/me ", false) && model.parts[0]?.text?.length > 4;
|
||||
const hasCommand = startsWith(model, "/me ", false);
|
||||
const hasArgument = model.parts[0]?.text?.length > 4 || model.parts.length > 1;
|
||||
return hasCommand && hasArgument;
|
||||
}
|
||||
|
||||
export function startsWith(model: EditorModel, prefix: string, caseSensitive = true): boolean {
|
||||
|
Reference in New Issue
Block a user