From 319e4f0f9543dda5712658e32ff426063e209cd8 Mon Sep 17 00:00:00 2001 From: Wentao Lyu <35-wentao.lyu@users.noreply.git.stereye.tech> Date: Wed, 29 Mar 2023 01:26:58 +0800 Subject: [PATCH] fix: set to default model in searchPlaceholderConversation fix: set max auth cookie to 7 days --- api/server/index.js | 3 ++- client/src/store/conversation.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/server/index.js b/api/server/index.js index 17a3e9f809..9f68518c2a 100644 --- a/api/server/index.js +++ b/api/server/index.js @@ -29,7 +29,8 @@ const projectPath = path.join(__dirname, '..', '..', 'client'); session({ secret: 'chatgpt-clone-random-secrect', resave: false, - saveUninitialized: true + saveUninitialized: true, + cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 } // 7 days }) ); diff --git a/client/src/store/conversation.js b/client/src/store/conversation.js index 7ae123c254..b59aef4af5 100644 --- a/client/src/store/conversation.js +++ b/client/src/store/conversation.js @@ -131,7 +131,7 @@ const useConversation = () => { ); }; - const searchPlaceholderConversation = ({ model = null, chatGptLabel = null, promptPrefix = null } = {}) => { + const searchPlaceholderConversation = () => { switchToConversation( { conversationId: 'search', @@ -140,9 +140,9 @@ const useConversation = () => { conversationSignature: null, clientId: null, invocationId: null, - model: model, - chatGptLabel: chatGptLabel, - promptPrefix: promptPrefix, + model: null, + chatGptLabel: null, + promptPrefix: null, user: null, suggestions: [], toneStyle: null