From 560fb3bd2d2c054695765c5ae1826cd93f83519c Mon Sep 17 00:00:00 2001 From: somebody Date: Fri, 21 Jul 2023 18:08:21 -0500 Subject: [PATCH] Fix occasional action highlight issue --- static/koboldai.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/static/koboldai.js b/static/koboldai.js index 8b70dd6a..0fde7169 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -597,13 +597,11 @@ function do_story_text_updates(action) { story_area.append(item); } } - - - if (action.action['Selected Text'].charAt(0) == ">") { - item.classList.add("action_mode_input"); - } else { - item.classList.remove("action_mode_input"); - } + + item.classList.toggle( + "action_mode_input", + action.action['Selected Text'].replaceAll("\n", "")[0] === ">" + ); if ('wi_highlighted_text' in action.action) { for (chunk of action.action['wi_highlighted_text']) {