From 27828d9ca86112c1d179c906197ed3158c9a9f68 Mon Sep 17 00:00:00 2001 From: kosette <35268640+Kosette@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:07:01 +0800 Subject: [PATCH 1/5] fix: update package version --- 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 78807a2c5fe8..0f2a84a531bb 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "NextChat", - "version": "2.14.2" + "version": "2.15.0" }, "tauri": { "allowlist": { From cf0c057164cb84078bc729e6185cae6e6c1c0906 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Sat, 7 Sep 2024 13:00:55 +0800 Subject: [PATCH 2/5] hotfix Mermaid can not render. close #5374 --- app/components/markdown.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 4b9e608c9a9b..dc11c572d7e2 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -163,7 +163,7 @@ export function PreCode(props: { children: any }) { ); } -function CustomCode(props: { children: any }) { +function CustomCode(props: { children: any; className?: string }) { const ref = useRef(null); const [collapsed, setCollapsed] = useState(true); const [showToggle, setShowToggle] = useState(false); @@ -182,6 +182,7 @@ function CustomCode(props: { children: any }) { return ( <> Date: Sat, 7 Sep 2024 16:24:52 +0800 Subject: [PATCH 3/5] Add crossOrigin="use-credentials" for site.webmanifest Add `crossOrigin="use-credentials"` to the `` element for `site.webmanifest` when the site is behind a proxy with authentication. --- app/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/layout.tsx b/app/layout.tsx index abefd69c1c95..fa087636a44c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -41,7 +41,7 @@ export default function RootLayout({ name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> - + From db58ca6c1d59dc6410c1fa55116926a6ec5fb1c6 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sat, 7 Sep 2024 21:32:18 +0800 Subject: [PATCH 4/5] fix(#5378): default plugin ids to empty array --- app/client/platforms/anthropic.ts | 2 +- app/client/platforms/moonshot.ts | 2 +- app/client/platforms/openai.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/client/platforms/anthropic.ts b/app/client/platforms/anthropic.ts index fce675a16714..7dd39c9cddce 100644 --- a/app/client/platforms/anthropic.ts +++ b/app/client/platforms/anthropic.ts @@ -203,7 +203,7 @@ export class ClaudeApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); return stream( path, diff --git a/app/client/platforms/moonshot.ts b/app/client/platforms/moonshot.ts index c38d3317bd01..cd10d2f6c158 100644 --- a/app/client/platforms/moonshot.ts +++ b/app/client/platforms/moonshot.ts @@ -125,7 +125,7 @@ export class MoonshotApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); return stream( chatPath, diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index b3b306d1d117..780ef0676dd5 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -244,7 +244,7 @@ export class ChatGPTApi implements LLMApi { const [tools, funcs] = usePluginStore .getState() .getAsTools( - useChatStore.getState().currentSession().mask?.plugin as string[], + useChatStore.getState().currentSession().mask?.plugin || [], ); // console.log("getAsTools", tools, funcs); stream( From 23ac2efd89139d3112981680b7dd8c2e1b283e3a Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Sat, 7 Sep 2024 22:12:42 +0800 Subject: [PATCH 5/5] hotfix and update version --- app/store/plugin.ts | 2 +- src-tauri/tauri.conf.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/store/plugin.ts b/app/store/plugin.ts index 74f0fbe17a4b..2356c6db0a7f 100644 --- a/app/store/plugin.ts +++ b/app/store/plugin.ts @@ -199,7 +199,7 @@ export const usePluginStore = createPersistStore( getAsTools(ids: string[]) { const plugins = get().plugins; - const selected = ids + const selected = (ids || []) .map((id) => plugins[id]) .filter((i) => i) .map((p) => FunctionToolService.add(p)); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0f2a84a531bb..78835d24da9a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "NextChat", - "version": "2.15.0" + "version": "2.15.1" }, "tauri": { "allowlist": {