Skip to content

Build your personal knowledge base with Trilium Notes

client/AI chat: fix an issue

Adorian Dorana358d2aa36de
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/chat_regenerate.spec.ts b/apps/client/src/widgets/type_widgets/llm_chat/chat_regenerate.spec.ts
index fdbcc3f459..e6db348a83 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/chat_regenerate.spec.ts
+++ b/apps/client/src/widgets/type_widgets/llm_chat/chat_regenerate.spec.ts
@@ -37,7 +37,7 @@ describe("canRegenerate", () => {
describe("conversationForRegenerate", () => {
it("keeps everything up to and including the last user message", () => {
const messages = [msg("u1", "user"), msg("a1", "assistant"), msg("u2", "user"), msg("t2", "assistant"), msg("a2", "assistant")];
- expect(conversationForRegenerate(messages).map(m => m.id)).toEqual(["u1", "a1", "u2"]);
+ expect(conversationForRegenerate(messages)?.map(m => m.id)).toEqual(["u1", "a1", "u2"]);
});
it("returns null when there is no user message", () => {