From 87726494273ff8f9ee1ecfdd959c980ed8edf0bc Mon Sep 17 00:00:00 2001
From: josephrocca <1167575+josephrocca@users.noreply.github.com>
Date: Tue, 14 Nov 2023 16:53:33 +0800
Subject: [PATCH] Fix bug with arrow key message variation switch
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 7b7464a..424854a 100644
--- a/index.html
+++ b/index.html
@@ -5872,7 +5872,7 @@
Your Characters
let messages = await db.messages.where("threadId").equals(threadId).toArray();
messages.sort((a,b) => a.order - b.order);
let lastMessage = messages[messages.length-1];
- let lastMessageEl = $.messageFeed.querySelector(".message:last-child");
+ let lastMessageEl = [...$.messageFeed.querySelectorAll(".message")].pop();
if(e.key === "ArrowRight") {
// the `lastMessage.variants` array has `null` in the position of the 'current' message, so if null is at the end of the array, and they pressed right arrow, then we recompute:
if(lastMessage.variants[lastMessage.variants.length-1] === null) {