From 6527074cdea14d1ba0506e611a300ea3d155acfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E5=BF=86?= Date: Thu, 23 Nov 2023 11:02:20 +0800 Subject: [PATCH 01/16] fix(locales): type error in pt.ts --- app/locales/pt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/locales/pt.ts b/app/locales/pt.ts index 55a404970..85226ed50 100644 --- a/app/locales/pt.ts +++ b/app/locales/pt.ts @@ -1,10 +1,10 @@ import { SubmitKey } from "../store/config"; -import { LocaleType } from "../locales/index"; +import { PartialLocaleType } from "../locales/index"; import { getClientConfig } from "../config/client"; const isApp = !!getClientConfig()?.isApp; -const pt: LocaleType = { +const pt: PartialLocaleType = { WIP: "Em breve...", Error: { Unauthorized: isApp From 261a8fd83b375b44b30113f824af1fcb477ace00 Mon Sep 17 00:00:00 2001 From: durian Date: Thu, 23 Nov 2023 15:36:10 +0800 Subject: [PATCH 02/16] fix(CUSTOM_MODELS):#3349 Dependency chatStore otherwise the session and view will not updated --- app/components/chat.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 4d9de7259..39abdd97b 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -449,8 +449,7 @@ export function ChatActions(props: { ); showToast(nextModel); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [currentModel, models]); + }, [chatStore, currentModel, models]); return (
From 06de3f5e6989e8ca131dfb1b3b788cb620a73367 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 24 Nov 2023 10:33:33 +0800 Subject: [PATCH 03/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3050fcc95..0b7dfa901 100644 --- a/README.md +++ b/README.md @@ -346,6 +346,7 @@ If you want to add a new translation, read this [document](./docs/translation.md [@piksonGit](https://github.com/piksonGit) [@ouyangzhiping](https://github.com/ouyangzhiping) [@wenjiavv](https://github.com/wenjiavv) +[@LeXwDeX](https://github.com/LeXwDeX) ### Contributor From b21931c667abf2825eca43d59f794471420c1db0 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Fri, 24 Nov 2023 11:36:14 +0800 Subject: [PATCH 04/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0b7dfa901..372b87096 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,7 @@ If you want to add a new translation, read this [document](./docs/translation.md [@ouyangzhiping](https://github.com/ouyangzhiping) [@wenjiavv](https://github.com/wenjiavv) [@LeXwDeX](https://github.com/LeXwDeX) +[@Licoy](https://github.com/Licoy) ### Contributor From ef9e86b50dabb363efd085a9f988723ecd657690 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Sat, 25 Nov 2023 05:03:34 +0700 Subject: [PATCH 05/16] Fix UI/UX Page Chats [Memory Prompt] [Stored Local Storage] - [+] fix(chat.ts): update the memory prompt in onFinish callback - [+] feat(chat.ts): update the current session with lastSummarizeIndex and memoryPrompt --- app/store/chat.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index ff7eb51b5..66a39d2b2 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -557,7 +557,10 @@ export const useChatStore = createPersistStore( }, onFinish(message) { console.log("[Memory] ", message); - session.lastSummarizeIndex = lastSummarizeIndex; + get().updateCurrentSession((session) => { + session.lastSummarizeIndex = lastSummarizeIndex; + session.memoryPrompt = message; // Update the memory prompt for stored it in local storage + }); }, onError(err) { console.error("[Summarize] ", err); From f9258878db7c5f725998d390f43412a2ce353254 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Sat, 25 Nov 2023 10:03:41 +0700 Subject: [PATCH 06/16] Fix Api Common [Server Side] [Console Log] - [+] fix(common.ts): fix console.log statement for [Org ID] to handle undefined value --- app/api/common.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index dd1cc0bb8..2d662c944 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -30,7 +30,10 @@ export async function requestOpenai(req: NextRequest) { console.log("[Proxy] ", path); console.log("[Base Url]", baseUrl); - console.log("[Org ID]", serverConfig.openaiOrgId); + // this fix [Org ID] undefined in server side if not using custom point + if (serverConfig.openaiOrgId) { + console.log("[Org ID]", serverConfig.openaiOrgId); + } const timeoutId = setTimeout( () => { From f9d916925eec45424bab3592e5eafca69e062a98 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Sat, 25 Nov 2023 10:23:16 +0700 Subject: [PATCH 07/16] Fixup Api Common [Server Side] [Console Log] - [+] fix(common.ts): fix condition to check if serverConfig.openaiOrgId is not undefined --- app/api/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/common.ts b/app/api/common.ts index 2d662c944..6b0d619df 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -31,7 +31,7 @@ export async function requestOpenai(req: NextRequest) { console.log("[Proxy] ", path); console.log("[Base Url]", baseUrl); // this fix [Org ID] undefined in server side if not using custom point - if (serverConfig.openaiOrgId) { + if (serverConfig.openaiOrgId !== undefined) { console.log("[Org ID]", serverConfig.openaiOrgId); } From 6f5699fe09cca8f6d872ae54d943fd74d35a883d Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Mon, 27 Nov 2023 04:49:15 +0700 Subject: [PATCH 08/16] Chore Docs (README.md) - [+] chore(README.md): add support for Korean and Indonesian languages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 372b87096..73a2b422c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ One-Click to get well-designed cross-platform ChatGPT web UI. - 预制角色功能(面具),方便地创建、分享和调试你的个性化对话 - 海量的内置 prompt 列表,来自[中文](https://github.com/PlexPt/awesome-chatgpt-prompts-zh)和[英文](https://github.com/f/awesome-chatgpt-prompts) - 自动压缩上下文聊天记录,在节省 Token 的同时支持超长对话 -- 多国语言支持:English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština +- 多国语言支持:English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština, 한국어, Indonesia - 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问 ## 开发计划 From d76e744eabe181bf9ce04effb48547427f63c7bb Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Mon, 27 Nov 2023 05:44:26 +0700 Subject: [PATCH 09/16] Fix & Refactor UI/UX Page [Auth] - [+] fix(auth.tsx): fix condition to set custom endpoint to true if it's app - [+] refactor(auth.tsx): update accessStore to set useCustomConfig to true --- app/components/auth.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/auth.tsx b/app/components/auth.tsx index 7962d46be..c1e5c52af 100644 --- a/app/components/auth.tsx +++ b/app/components/auth.tsx @@ -24,8 +24,12 @@ export function AuthPage() { }; // Reset access code to empty string useEffect(() => { - if (getClientConfig()?.isApp) { + const clientConfig = getClientConfig(); + if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app navigate(Path.Settings); + accessStore.update((state) => { + state.useCustomConfig = true; + }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); From bf5e7aaa484c42201178830d82d126f76ee55ed2 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Mon, 27 Nov 2023 07:03:41 +0700 Subject: [PATCH 10/16] Feat UI/UX Page [Settings] - [+] feat(settings.tsx): set useCustomConfig to true if clientConfig.isApp is truthy --- app/components/settings.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 1edb3c6ba..53ca13f2f 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -635,6 +635,11 @@ export function Settings() { navigate(Path.Home); } }; + if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app + accessStore.update((state) => { + state.useCustomConfig = true; + }); + } document.addEventListener("keydown", keydownEvent); return () => { document.removeEventListener("keydown", keydownEvent); From 7df868e22a66db618688878bbe4753c4dd3c495c Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Mon, 27 Nov 2023 07:12:57 +0700 Subject: [PATCH 11/16] Revert "Fix & Refactor UI/UX Page [Auth]" This reverts commit d76e744eabe181bf9ce04effb48547427f63c7bb. Reason: Move to commits bf5e7aaa484c42201178830d82d126f76ee55ed2 --- app/components/auth.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/components/auth.tsx b/app/components/auth.tsx index c1e5c52af..7962d46be 100644 --- a/app/components/auth.tsx +++ b/app/components/auth.tsx @@ -24,12 +24,8 @@ export function AuthPage() { }; // Reset access code to empty string useEffect(() => { - const clientConfig = getClientConfig(); - if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app + if (getClientConfig()?.isApp) { navigate(Path.Settings); - accessStore.update((state) => { - state.useCustomConfig = true; - }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); From dda40e29f440fdbdb0e17bada3f7a09f658f63cd Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Mon, 27 Nov 2023 08:07:53 +0700 Subject: [PATCH 12/16] Fix & Refactor UI/UX Page [Settings] - [+] fix(settings.tsx): fix conditional rendering of ListItem based on clientConfig.isApp - [+] refactor(settings.tsx): improve readability of conditional rendering code --- app/components/settings.tsx | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 53ca13f2f..f53024d6c 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -914,21 +914,26 @@ export function Settings() { {!accessStore.hideUserApiKey && ( <> - - - accessStore.update( - (access) => - (access.useCustomConfig = e.currentTarget.checked), - ) - } - > - + { + // Conditionally render the following ListItem based on clientConfig.isApp + !clientConfig?.isApp && ( // only show if isApp is false + + + accessStore.update( + (access) => + (access.useCustomConfig = e.currentTarget.checked), + ) + } + > + + ) + } {accessStore.useCustomConfig && ( <> Date: Mon, 27 Nov 2023 15:28:34 +0800 Subject: [PATCH 13/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 372b87096..aaf142667 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,7 @@ If you want to add a new translation, read this [document](./docs/translation.md [@wenjiavv](https://github.com/wenjiavv) [@LeXwDeX](https://github.com/LeXwDeX) [@Licoy](https://github.com/Licoy) +[@shangmin2009](https://github.com/shangmin2009) ### Contributor From cf50299b142a40d1b043f0b3ceb3cc6c4c5b249d Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Wed, 29 Nov 2023 11:39:21 +0800 Subject: [PATCH 14/16] Update README_CN.md --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 0ef508f61..d73479658 100644 --- a/README_CN.md +++ b/README_CN.md @@ -139,7 +139,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro OPENAI_API_KEY= # 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址 -BASE_URL=https://a.nextweb.fun/api/proxy +BASE_URL=https://b.nextweb.fun/api/proxy ``` ### 本地开发 From 54df355014c104b324fc76f38c271a2a15fd5470 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Tue, 5 Dec 2023 07:26:11 +0700 Subject: [PATCH 15/16] Fix Trim Topic in Indonesia Language - [+] fix(utils.ts): fix trimTopic function to remove double quotes from the start and end of the string, and remove specified punctuation from the end of the string --- app/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/utils.ts b/app/utils.ts index acc140ac3..ac7e80e7a 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -3,7 +3,10 @@ import { showToast } from "./components/ui-lib"; import Locale from "./locales"; export function trimTopic(topic: string) { - return topic.replace(/[,。!?”“"、,.!?]*$/, ""); + // Fix an issue where double quotes still show in the Indonesian language + // This will remove the specified punctuation from the end of the string + // and also trim quotes from both the start and end if they exist. + return topic.replace(/^["“”]+|["“”]+$/g, "").replace(/[,。!?”“"、,.!?]*$/, ""); } export async function copyToClipboard(text: string) { From cae4655785837696f6af3022c916035e43298d46 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Mon, 11 Dec 2023 15:59:37 +0800 Subject: [PATCH 16/16] 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 182d00792..7f2ffb0f6 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.12" + "version": "2.9.13" }, "tauri": { "allowlist": {