forked from prehistoric-systems/chatpad
fix: array clone before revers
This commit is contained in:
parent
d894491dd0
commit
00f368b6cc
1 changed files with 1 additions and 1 deletions
|
|
@ -203,7 +203,7 @@ export function ChatRoute() {
|
|||
event.preventDefault();
|
||||
|
||||
const newMsgIndex = userMsgIndex + (event.code === "ArrowUp" ? 1 : -1);
|
||||
const allMessages = [contentDraft, ...userMessages.reverse()];
|
||||
const allMessages = [contentDraft, ...Array.from(userMessages).reverse()];
|
||||
|
||||
if (newMsgIndex < 0 || newMsgIndex >= allMessages.length) {
|
||||
// index out of range, do nothing
|
||||
|
|
|
|||
Loading…
Reference in a new issue