diff --git a/public/script.js b/public/script.js index d01a8ffdd..e3efa7701 100644 --- a/public/script.js +++ b/public/script.js @@ -2217,7 +2217,7 @@ function setInContextMessages(lastmsg, type) { lastmsg++; } - $(`#chat .mes:nth-last-child(${lastmsg} of :not([is_system="true"])`).addClass('lastInContext'); + $('#chat .mes:not([is_system="true"])').eq(-lastmsg).addClass('lastInContext'); } // TODO: move to textgen-settings.js