From ad5093ce0593e21df3e7c782a0396725662a425a Mon Sep 17 00:00:00 2001 From: KeithHello Date: Wed, 4 Oct 2023 16:38:28 +0900 Subject: [PATCH 1/5] Change log - config.ts - line 72 remove type confirmation of x as x always has type 'number' - line 135 remove redundant local variable - chat.ts - delete unused import --- app/locales/index.ts | 2 +- app/store/chat.ts | 3 --- app/store/config.ts | 10 ++++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/locales/index.ts b/app/locales/index.ts index 79e314fac..a32d3207c 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -65,7 +65,7 @@ export const ALL_LANG_OPTIONS: Record = { }; const LANG_KEY = "lang"; -const DEFAULT_LANG = "en"; +const DEFAULT_LANG = "cn"; const fallbackLang = en; const targetLang = ALL_LANGS[getLang()] as LocaleType; diff --git a/app/store/chat.ts b/app/store/chat.ts index 269cc4a33..56ac8db6c 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -1,6 +1,3 @@ -import { create } from "zustand"; -import { persist } from "zustand/middleware"; - import { trimTopic } from "../utils"; import Locale, { getLang } from "../locales"; diff --git a/app/store/config.ts b/app/store/config.ts index 956e5f3eb..b64884795 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -46,13 +46,13 @@ export const DEFAULT_CONFIG = { modelConfig: { model: "gpt-3.5-turbo" as ModelType, - temperature: 0.5, + temperature: 0.6, top_p: 1, max_tokens: 2000, presence_penalty: 0, frequency_penalty: 0, sendMemory: true, - historyMessageCount: 4, + historyMessageCount: 1, compressMessageLengthThreshold: 1000, enableInjectSystemPrompts: true, template: DEFAULT_INPUT_TEMPLATE, @@ -69,7 +69,7 @@ export function limitNumber( max: number, defaultValue: number, ) { - if (typeof x !== "number" || isNaN(x)) { + if (isNaN(x)) { return defaultValue; } @@ -132,9 +132,7 @@ export const useAppConfig = createPersistStore( .customModels.split(",") .filter((v) => !!v && v.length > 0) .map((m) => ({ name: m, available: true })); - - const models = get().models.concat(customModels); - return models; + return get().models.concat(customModels); }, }), { From 1505372e204d8363ec9c67a61d004806de81c200 Mon Sep 17 00:00:00 2001 From: KeithHello Date: Wed, 4 Oct 2023 18:08:29 +0900 Subject: [PATCH 2/5] Change log - config.ts - line 72: remove type confirmation of x as x always has type 'number' - line 135: remove the redundant local variable - chat.ts - delete the unused import --- app/locales/index.ts | 2 +- app/store/config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/locales/index.ts b/app/locales/index.ts index a32d3207c..79e314fac 100644 --- a/app/locales/index.ts +++ b/app/locales/index.ts @@ -65,7 +65,7 @@ export const ALL_LANG_OPTIONS: Record = { }; const LANG_KEY = "lang"; -const DEFAULT_LANG = "cn"; +const DEFAULT_LANG = "en"; const fallbackLang = en; const targetLang = ALL_LANGS[getLang()] as LocaleType; diff --git a/app/store/config.ts b/app/store/config.ts index b64884795..ca230cc3c 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -46,13 +46,13 @@ export const DEFAULT_CONFIG = { modelConfig: { model: "gpt-3.5-turbo" as ModelType, - temperature: 0.6, + temperature: 0.5, top_p: 1, max_tokens: 2000, presence_penalty: 0, frequency_penalty: 0, sendMemory: true, - historyMessageCount: 1, + historyMessageCount: 4, compressMessageLengthThreshold: 1000, enableInjectSystemPrompts: true, template: DEFAULT_INPUT_TEMPLATE, From bdb49b11711977638a41845de36c6ea4166f2ef2 Mon Sep 17 00:00:00 2001 From: Kong Gaowen Date: Mon, 9 Oct 2023 18:50:10 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。 --- app/components/home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 07d5e88b3..dd22142d7 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -129,7 +129,7 @@ function Screen() { const isAuth = location.pathname === Path.Auth; const isMobileScreen = useMobileScreen(); const shouldTightBorder = - config.tightBorder && !isMobileScreen && !getClientConfig()?.isApp; + config.tightBorder && !isMobileScreen && getClientConfig()?.isApp; useEffect(() => { loadAsyncGoogleFont(); From f21f922160a6f024d0fe5e52a0ced59144c2d2cc Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Mon, 9 Oct 2023 22:46:36 +0800 Subject: [PATCH 4/5] Update tauri.conf.json --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 68f9c07c0..e530203f6 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "ChatGPT Next Web", - "version": "2.9.8" + "version": "2.9.9" }, "tauri": { "allowlist": { From f54db695af55ea925369950be9b1b8988461544b Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Tue, 10 Oct 2023 11:54:25 +0800 Subject: [PATCH 5/5] fix: #2981 full screen button not works --- app/components/home.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index dd22142d7..811cbdf51 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -128,8 +128,7 @@ function Screen() { const isHome = location.pathname === Path.Home; const isAuth = location.pathname === Path.Auth; const isMobileScreen = useMobileScreen(); - const shouldTightBorder = - config.tightBorder && !isMobileScreen && getClientConfig()?.isApp; + const shouldTightBorder = getClientConfig()?.isApp || (config.tightBorder && !isMobileScreen); useEffect(() => { loadAsyncGoogleFont();