Skip to content

Commit

Permalink
Fix bug with arrow key message variation switch
Browse files Browse the repository at this point in the history
  • Loading branch information
josephrocca authored Nov 14, 2023
1 parent e7a581d commit 8772649
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5872,7 +5872,7 @@ <h2 style="text-align:center;margin-bottom: 0.5rem;">Your Characters</h2>
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) {
Expand Down

0 comments on commit 8772649

Please sign in to comment.