From 840277f5846ab13eaec0f3848ebd86d3a4ade410 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 15 Aug 2023 22:42:55 +0800 Subject: [PATCH 1/3] fix: #2566 click avatar to edit context messages --- app/components/chat.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index f661d0a47..656208585 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -1123,9 +1123,9 @@ function _Chat() { 10, ); chatStore.updateCurrentSession((session) => { - const m = session.messages.find( - (m) => m.id === message.id, - ); + const m = session.mask.context + .concat(session.messages) + .find((m) => m.id === message.id); if (m) { m.content = newMessage; } From ed62c871567e9c5781f742932b0e0521833cded0 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 15 Aug 2023 22:50:42 +0800 Subject: [PATCH 2/3] feat: close #2638 hide auth page and use better unauth tips --- app/components/auth.tsx | 9 +++++++++ app/locales/cn.ts | 8 ++++++-- app/locales/en.ts | 8 ++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/components/auth.tsx b/app/components/auth.tsx index de0df4542..1ca83dcd3 100644 --- a/app/components/auth.tsx +++ b/app/components/auth.tsx @@ -7,6 +7,8 @@ import { useAccessStore } from "../store"; import Locale from "../locales"; import BotIcon from "../icons/bot.svg"; +import { useEffect } from "react"; +import { getClientConfig } from "../config/client"; export function AuthPage() { const navigate = useNavigate(); @@ -14,6 +16,13 @@ export function AuthPage() { const goHome = () => navigate(Path.Home); + useEffect(() => { + if (getClientConfig()?.isApp) { + navigate(Path.Settings); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + return (
diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 3929e09e7..19e804b3a 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -1,10 +1,14 @@ +import { getClientConfig } from "../config/client"; import { SubmitKey } from "../store/config"; +const isApp = !!getClientConfig()?.isApp; + const cn = { WIP: "该功能仍在开发中……", Error: { - Unauthorized: - "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。", + Unauthorized: isApp + ? "检测到无效 API Key,请前往[设置](/#/settings)页检查 API Key 是否配置正确。" + : "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。", }, Auth: { Title: "需要密码", diff --git a/app/locales/en.ts b/app/locales/en.ts index d37149c92..64cdc38bb 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -1,12 +1,16 @@ +import { getClientConfig } from "../config/client"; import { SubmitKey } from "../store/config"; import { LocaleType } from "./index"; // if you are adding a new translation, please use PartialLocaleType instead of LocaleType + +const isApp = !!getClientConfig()?.isApp; const en: LocaleType = { WIP: "Coming Soon...", Error: { - Unauthorized: - "Unauthorized access, please enter access code in [auth](/#/auth) page.", + Unauthorized: isApp + ? "Invalid API Key, please check it in [Settings](/#/settings) page." + : "Unauthorized access, please enter access code in [auth](/#/auth) page, or enter your OpenAI API Key.", }, Auth: { Title: "Need Access Code", From 5a7ec38ecdb516da0c7f3908ccebc03093f3e5bc Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Wed, 16 Aug 2023 11:22:51 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1662e8c7e..e1f42e1a0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ One-Click to get well-designed cross-platform ChatGPT web UI. [![MacOS][MacOS-image]][download-url] [![Linux][Linux-image]][download-url] -[Web App](https://chatgpt.nextweb.fun/) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [Discord](https://discord.gg/YCkeafCafC) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa) +[Web App](https://chatgpt.nextweb.fun/) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [Discord](https://discord.gg/YCkeafCafC) / [Twitter](https://twitter.com/mortiest_ricky) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa) [网页版](https://chatgpt.nextweb.fun/) / [客户端](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [反馈](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [QQ 群](https://github.com/Yidadaa/ChatGPT-Next-Web/discussions/1724) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg)