Allow using room pills in slash commands (#7513)

This commit is contained in:
Michael Telatynski 2022-01-12 09:40:18 +00:00 committed by GitHub
parent 31247a50ca
commit b835588331
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 193 additions and 249 deletions

View file

@ -179,7 +179,7 @@ export function textSerialize(model: EditorModel): string {
}
export function containsEmote(model: EditorModel): boolean {
return startsWith(model, "/me ", false);
return startsWith(model, "/me ", false) && model.parts[0]?.text?.length > 4;
}
export function startsWith(model: EditorModel, prefix: string, caseSensitive = true): boolean {