From f245b98600b8d80043902d08854cc29051cb44c3 Mon Sep 17 00:00:00 2001 From: Athul Date: Wed, 19 Jun 2024 14:16:50 +0530 Subject: [PATCH] fix/router-update --- frontend/src/routes/Router.jsx | 14 +++++++++++--- frontend/src/store/chat-store.js | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/Router.jsx b/frontend/src/routes/Router.jsx index 2ce7d3894..7d4ab0cec 100644 --- a/frontend/src/routes/Router.jsx +++ b/frontend/src/routes/Router.jsx @@ -33,7 +33,8 @@ let TrialRoutes; let RequirePlatformAdmin; let PlatformAdminPage; let AppDeployments; -let ChatApp; +let ChatAppPage; +let ChatAppLayout; try { TrialRoutes = require("../plugins/subscription/trial-page/TrialEndPage.jsx").TrialEndPage; @@ -43,7 +44,10 @@ try { require("../plugins/frictionless-onboard/platform-admin-page/PlatformAdminPage.jsx").PlatformAdminPage; AppDeployments = require("../plugins/app-deployment/AppDeployments.jsx").AppDeployments; - ChatApp = require("../plugins/app-deployment/ChatApp.jsx").ChatApp; + ChatAppPage = + require("../plugins/app-deployment/chat-app/ChatAppPage.jsx").ChatAppPage; + ChatAppLayout = + require("../plugins/app-deployment/chat-app/ChatAppLayout.jsx").ChatAppLayout; } catch (err) { TrialRoutes = NotFound; } @@ -63,6 +67,11 @@ function Router() { }> } /> + {ChatAppLayout && ChatAppPage && ( + }> + } /> + + )} }> } /> } /> )} - {ChatApp && } />} } /> }> } /> diff --git a/frontend/src/store/chat-store.js b/frontend/src/store/chat-store.js index 9b9c7cae5..1d073d475 100644 --- a/frontend/src/store/chat-store.js +++ b/frontend/src/store/chat-store.js @@ -32,7 +32,7 @@ const useChatStore = create((setState, getState) => ({ }, updateChatTranscript: (record) => { const existingState = { ...getState() }; - existingState.chatTranscript = [record, ...existingState.chatTranscript]; + existingState.chatTranscript = [...existingState.chatTranscript, record]; setState({ ...existingState }); }, setCurrentContext: (context) => {