From 27dd6ef14ea4055a8bf6e1fe2bee39e2287bbfad Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 19 Sep 2024 05:15:06 +0200 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 5bd700712..40293ee5a 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -115,9 +115,10 @@ $: if (history.currentId !== null) { let _messages = []; + console.log(history.currentId); let currentMessage = history.messages[history.currentId]; - while (currentMessage !== null) { + while (currentMessage) { _messages.unshift({ ...currentMessage }); currentMessage = currentMessage.parentId !== null ? history.messages[currentMessage.parentId] : null;