From e93ca53af693fa1ec2186ca9417af122bb5e8e09 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 10 Feb 2025 15:15:33 -0500 Subject: from last --- src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx index 4453fe140..89070ee5a 100644 --- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx +++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx @@ -415,6 +415,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { const data = (doc as parsedDocData).data; const ndoc = (() => { switch (doc.doc_type) { + default: case supportedDocumentTypes.text: return Docs.Create.TextDocument(data as string, options); case supportedDocumentTypes.comparison: return this.createComparison(data as parsedDoc[], options); case supportedDocumentTypes.flashcard: return this.createFlashcard(data as parsedDoc[], options); @@ -447,7 +448,6 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { // case supportedDocumentTypes.chat: return Docs.Create.ChatDocument(options); // case supportedDocumentTypes.trail: return Docs.Create.PresDocument(options); // case supportedDocumentTypes.trail: return Docs.Create.FreeformDocument([], options); - default: return Docs.Create.TextDocument(data as string, options); } // prettier-ignore })(); @@ -520,12 +520,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { @action createFlashcard = (data: parsedDoc[] | string[], options: DocumentOptions) => { const [front, back] = data; - - const sideOptions: DocumentOptions = { - backgroundColor: options.backgroundColor, - _width: options._width, - _height: options._height || 300, - }; + const sideOptions = { _height: 300, ...options }; // Create front and back text documents const side1 = typeof front === 'string' ? Docs.Create.CenteredTextCreator('question', front as string, sideOptions) : this.whichDoc(front, false); -- cgit v1.2.3-70-g09d2