aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx9
1 files changed, 2 insertions, 7 deletions
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<FieldViewProps>() {
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<FieldViewProps>() {
// 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<FieldViewProps>() {
@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);