diff --git a/assets/js/Containers/FrevaGPT/index.js b/assets/js/Containers/FrevaGPT/index.js index 90ce240f..203140e9 100644 --- a/assets/js/Containers/FrevaGPT/index.js +++ b/assets/js/Containers/FrevaGPT/index.js @@ -1,5 +1,5 @@ import React, { useState, useEffect, useRef } from 'react'; -import { Container, Row, Col, FormControl, InputGroup, Card } from 'react-bootstrap'; +import { Container, Row, Col, FormControl, InputGroup, Card, Button } from 'react-bootstrap'; import { browserHistory } from "react-router"; import { isEmpty } from 'lodash'; import Markdown from 'react-markdown'; @@ -164,6 +164,16 @@ const ChatBot = () => { thread_id: thread.current, }).toString()); } + + function startNewChat() { + setConversation([]); + thread.current = ""; + browserHistory.push({ + pathname: '/chatbot/', + search: "", + }); + window.scrollTo(0, 0) + } return ( @@ -230,14 +240,16 @@ const ChatBot = () => { + {answerLoading + ? () + : null + } + - {!answerLoading - ? () - : () - } +