fix: refresh page

This commit is contained in:
archer
2023-06-18 22:19:49 +08:00
parent ff2043c0fb
commit 6c62d80a4c
5 changed files with 17 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { connectToDatabase } from '@/service/mongo';
import { authUser, authModel, getApiKey, authShareChat, type AuthType } from '@/service/utils/auth';
import { authUser, authModel, getApiKey, authShareChat } from '@/service/utils/auth';
import { modelServiceToolMap, V2_StreamResponse } from '@/service/utils/chat';
import { jsonRes } from '@/service/response';
import { ChatModelMap } from '@/constants/model';

View File

@@ -156,6 +156,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
onSuccess(res) {
res && reset(res);
modelId && setLastModelId(modelId);
setRefresh(!refresh);
},
onError(err: any) {
toast({
@@ -278,6 +279,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
width={['100%', '260px']}
min={100}
max={tokenLimit}
step={50}
activeVal={getValues('chat.maxToken')}
setVal={(val) => {
setValue('chat.maxToken', val);