From ef80a0b0b473a4d2a422e6a811c2149340a1e4ca Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 16 Jun 2020 14:06:42 +0100 Subject: [PATCH] avoid negatives --- src/editor/serialize.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts index 40038114d4..fc35f1e2ea 100644 --- a/src/editor/serialize.ts +++ b/src/editor/serialize.ts @@ -62,15 +62,15 @@ export function textSerialize(model: EditorModel) { } export function containsEmote(model: EditorModel) { - return startsWith(model, "/me ", true); + return startsWith(model, "/me ", false); } -export function startsWith(model: EditorModel, prefix: string, caseInsensitive = false) { +export function startsWith(model: EditorModel, prefix: string, caseSensitive = true) { const firstPart = model.parts[0]; // part type will be "plain" while editing, // and "command" while composing a message. let text = firstPart && firstPart.text; - if (caseInsensitive) { + if (!caseSensitive) { prefix = prefix.toLowerCase(); text = text.toLowerCase(); }