diff --git a/app/api/common.ts b/app/api/common.ts
index fcb3d923649..a75f2de5cfa 100644
--- a/app/api/common.ts
+++ b/app/api/common.ts
@@ -112,16 +112,16 @@ export async function requestOpenai(req: NextRequest) {
try {
const res = await fetch(fetchUrl, fetchOptions);
- // Extract the OpenAI-Organization header from the response
- const openaiOrganizationHeader = res.headers.get("OpenAI-Organization");
-
- // Check if serverConfig.openaiOrgId is defined and not an empty string
- if (serverConfig.openaiOrgId && serverConfig.openaiOrgId.trim() !== "") {
- // If openaiOrganizationHeader is present, log it; otherwise, log that the header is not present
- console.log("[Org ID]", openaiOrganizationHeader);
- } else {
- console.log("[Org ID] is not set up.");
- }
+ // Extract the OpenAI-Organization header from the response
+ const openaiOrganizationHeader = res.headers.get("OpenAI-Organization");
+
+ // Check if serverConfig.openaiOrgId is defined and not an empty string
+ if (serverConfig.openaiOrgId && serverConfig.openaiOrgId.trim() !== "") {
+ // If openaiOrganizationHeader is present, log it; otherwise, log that the header is not present
+ console.log("[Org ID]", openaiOrganizationHeader);
+ } else {
+ console.log("[Org ID] is not set up.");
+ }
// to prevent browser prompt for credentials
const newHeaders = new Headers(res.headers);
@@ -129,6 +129,7 @@ export async function requestOpenai(req: NextRequest) {
// to disable nginx buffering
newHeaders.set("X-Accel-Buffering", "no");
+
// Conditionally delete the OpenAI-Organization header from the response if [Org ID] is undefined or empty (not setup in ENV)
// Also, this is to prevent the header from being sent to the client
if (!serverConfig.openaiOrgId || serverConfig.openaiOrgId.trim() === "") {
@@ -141,6 +142,7 @@ export async function requestOpenai(req: NextRequest) {
// The browser will try to decode the response with brotli and fail
newHeaders.delete("content-encoding");
+
return new Response(res.body, {
status: res.status,
statusText: res.statusText,
diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts
index b6eb8d3dfab..a786f5275f4 100644
--- a/app/client/platforms/google.ts
+++ b/app/client/platforms/google.ts
@@ -120,9 +120,7 @@ export class GeminiProApi implements LLMApi {
if (!baseUrl) {
baseUrl = isApp
- ? DEFAULT_API_HOST +
- "/api/proxy/google/" +
- Google.ChatPath(modelConfig.model)
+ ? DEFAULT_API_HOST + "/api/proxy/google/" + Google.ChatPath(modelConfig.model)
: this.path(Google.ChatPath(modelConfig.model));
}
@@ -141,7 +139,7 @@ export class GeminiProApi implements LLMApi {
() => controller.abort(),
REQUEST_TIMEOUT_MS,
);
-
+
if (shouldStream) {
let responseText = "";
let remainText = "";
diff --git a/app/components/auth.tsx b/app/components/auth.tsx
index 5c8b4fc00b1..57118349bac 100644
--- a/app/components/auth.tsx
+++ b/app/components/auth.tsx
@@ -50,33 +50,33 @@ export function AuthPage() {
);
}}
/>
- {/*{!accessStore.hideUserApiKey ? (*/}
- {/* <>*/}
- {/*
{Locale.Auth.SubTips}
*/}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) => (access.openaiApiKey = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) => (access.googleApiKey = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* >*/}
- {/*) : null}*/}
+ {!accessStore.hideUserApiKey ? (
+ <>
+ {Locale.Auth.SubTips}
+ {
+ accessStore.update(
+ (access) => (access.openaiApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+ {
+ accessStore.update(
+ (access) => (access.googleApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+ >
+ ) : null}
- {/*{couldStop && (*/}
- {/* }*/}
- {/* />*/}
- {/*)}*/}
- {/*{!props.hitBottom && (*/}
- {/* }*/}
- {/* />*/}
- {/*)}*/}
- {/*{props.hitBottom && (*/}
- {/* }*/}
- {/* />*/}
- {/*)}*/}
-
- {/*{showUploadImage && (*/}
- {/* : }*/}
- {/* />*/}
- {/*)}*/}
- {/**/}
- {/* {theme === Theme.Auto ? (*/}
- {/* */}
- {/* ) : theme === Theme.Light ? (*/}
- {/* */}
- {/* ) : theme === Theme.Dark ? (*/}
- {/* */}
- {/* ) : null}*/}
- {/* >*/}
- {/* }*/}
- {/*/>*/}
-
- {/* }*/}
- {/*/>*/}
-
- {/* {*/}
- {/* navigate(Path.Masks);*/}
- {/* }}*/}
- {/* text={Locale.Chat.InputActions.Masks}*/}
- {/* icon={ }*/}
- {/*/>*/}
-
- {/* }*/}
- {/* onClick={() => {*/}
- {/* chatStore.updateCurrentSession((session) => {*/}
- {/* if (session.clearContextIndex === session.messages.length) {*/}
- {/* session.clearContextIndex = undefined;*/}
- {/* } else {*/}
- {/* session.clearContextIndex = session.messages.length;*/}
- {/* session.memoryPrompt = ""; // will clear memory*/}
- {/* }*/}
- {/* });*/}
- {/* }}*/}
- {/*/>*/}
+ {couldStop && (
+ }
+ />
+ )}
+ {!props.hitBottom && (
+ }
+ />
+ )}
+ {props.hitBottom && (
+ }
+ />
+ )}
+
+ {showUploadImage && (
+ : }
+ />
+ )}
+
+ {theme === Theme.Auto ? (
+
+ ) : theme === Theme.Light ? (
+
+ ) : theme === Theme.Dark ? (
+
+ ) : null}
+ >
+ }
+ />
+
+ }
+ />
+
+ {
+ navigate(Path.Masks);
+ }}
+ text={Locale.Chat.InputActions.Masks}
+ icon={ }
+ />
+
+ }
+ onClick={() => {
+ chatStore.updateCurrentSession((session) => {
+ if (session.clearContextIndex === session.messages.length) {
+ session.clearContextIndex = undefined;
+ } else {
+ session.clearContextIndex = session.messages.length;
+ session.memoryPrompt = ""; // will clear memory
+ }
+ });
+ }}
+ />
setShowModelSelector(true)}
@@ -1089,6 +1089,7 @@ function _Chat() {
if (payload.url) {
accessStore.update((access) => (access.openaiUrl = payload.url!));
}
+ accessStore.update((access) => (access.useCustomConfig = true));
});
}
} catch {
@@ -1233,25 +1234,25 @@ function _Chat() {
- {/*{!isMobileScreen && (*/}
- {/*
*/}
- {/* }*/}
- {/* bordered*/}
- {/* onClick={() => setIsEditingMessage(true)}*/}
- {/* />*/}
- {/*
*/}
- {/*)}*/}
- {/*
*/}
- {/* }*/}
- {/* bordered*/}
- {/* title={Locale.Chat.Actions.Export}*/}
- {/* onClick={() => {*/}
- {/* setShowExport(true);*/}
- {/* }}*/}
- {/* />*/}
- {/*
*/}
+ {!isMobileScreen && (
+
+ }
+ bordered
+ onClick={() => setIsEditingMessage(true)}
+ />
+
+ )}
+
+ }
+ bordered
+ title={Locale.Chat.Actions.Export}
+ onClick={() => {
+ setShowExport(true);
+ }}
+ />
+
{showMaxIcon && (
- {/**/}
- {/* {checkingUpdate ? (*/}
- {/* */}
- {/* ) : hasNewVersion ? (*/}
- {/* */}
- {/* {Locale.Settings.Update.GoToUpdate}*/}
- {/* */}
- {/* ) : (*/}
- {/* }*/}
- {/* text={Locale.Settings.Update.CheckUpdate}*/}
- {/* onClick={() => checkUpdate(true)}*/}
- {/* />*/}
- {/* )}*/}
- {/* */}
-
- {/**/}
- {/* {*/}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.submitKey = e.target.value as any as SubmitKey),*/}
- {/* );*/}
- {/* }}*/}
- {/* >*/}
- {/* {Object.values(SubmitKey).map((v) => (*/}
- {/* */}
- {/* {v}*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/* */}
-
- {/**/}
- {/* {*/}
- {/* updateConfig(*/}
- {/* (config) => (config.theme = e.target.value as any as Theme),*/}
- {/* );*/}
- {/* }}*/}
- {/* >*/}
- {/* {Object.values(Theme).map((v) => (*/}
- {/* */}
- {/* {v}*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/* */}
-
- {/**/}
- {/* {*/}
- {/* changeLang(e.target.value as any);*/}
- {/* }}*/}
- {/* >*/}
- {/* {AllLangs.map((lang) => (*/}
- {/* */}
- {/* {ALL_LANG_OPTIONS[lang]}*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/* */}
+
+ {checkingUpdate ? (
+
+ ) : hasNewVersion ? (
+
+ {Locale.Settings.Update.GoToUpdate}
+
+ ) : (
+ }
+ text={Locale.Settings.Update.CheckUpdate}
+ onClick={() => checkUpdate(true)}
+ />
+ )}
+
+
+
+ {
+ updateConfig(
+ (config) =>
+ (config.submitKey = e.target.value as any as SubmitKey),
+ );
+ }}
+ >
+ {Object.values(SubmitKey).map((v) => (
+
+ {v}
+
+ ))}
+
+
+
+
+ {
+ updateConfig(
+ (config) => (config.theme = e.target.value as any as Theme),
+ );
+ }}
+ >
+ {Object.values(Theme).map((v) => (
+
+ {v}
+
+ ))}
+
+
+
+
+ {
+ changeLang(e.target.value as any);
+ }}
+ >
+ {AllLangs.map((lang) => (
+
+ {ALL_LANG_OPTIONS[lang]}
+
+ ))}
+
+
- {/**/}
- {/* */}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.enableAutoGenerateTitle = e.currentTarget.checked),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
-
- {/**/}
- {/* */}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.sendPreviewBubble = e.currentTarget.checked),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
+
+
+ updateConfig(
+ (config) =>
+ (config.enableAutoGenerateTitle = e.currentTarget.checked),
+ )
+ }
+ >
+
+
+
+
+ updateConfig(
+ (config) =>
+ (config.sendPreviewBubble = e.currentTarget.checked),
+ )
+ }
+ >
+
+
+
+
+
+
+
+
+ updateConfig(
+ (config) =>
+ (config.dontShowMaskSplashScreen =
+ !e.currentTarget.checked),
+ )
+ }
+ >
+
+
+
+
+ updateConfig(
+ (config) =>
+ (config.hideBuiltinMasks = e.currentTarget.checked),
+ )
+ }
+ >
+
+
+
+
+
+
+ updateConfig(
+ (config) =>
+ (config.disablePromptHint = e.currentTarget.checked),
+ )
+ }
+ >
+
+
+
+ }
+ text={Locale.Settings.Prompt.Edit}
+ onClick={() => setShowPromptModal(true)}
+ />
+
+
+
+
+ {showAccessCode && (
+
+ {
+ accessStore.update(
+ (access) => (access.accessCode = e.currentTarget.value),
+ );
+ }}
+ />
+
+ )}
+
+ {!accessStore.hideUserApiKey && (
+ <>
+ {
+ // 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 && (
+ <>
+
+ {
+ accessStore.update(
+ (access) =>
+ (access.provider = e.target
+ .value as ServiceProvider),
+ );
+ }}
+ >
+ {Object.entries(ServiceProvider).map(([k, v]) => (
+
+ {k}
+
+ ))}
+
+
+
+ {accessStore.provider === ServiceProvider.OpenAI && (
+ <>
+
+
+ accessStore.update(
+ (access) =>
+ (access.openaiUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) =>
+ (access.openaiApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+
+ >
+ )}
+ {accessStore.provider === ServiceProvider.Azure && (
+ <>
+
+
+ accessStore.update(
+ (access) =>
+ (access.azureUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) =>
+ (access.azureApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+
+
+
+ accessStore.update(
+ (access) =>
+ (access.azureApiVersion =
+ e.currentTarget.value),
+ )
+ }
+ >
+
+ >
+ )}
+ {accessStore.provider === ServiceProvider.Google && (
+ <>
+
+
+ accessStore.update(
+ (access) =>
+ (access.googleUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) =>
+ (access.googleApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+
+
+
+ accessStore.update(
+ (access) =>
+ (access.googleApiVersion =
+ e.currentTarget.value),
+ )
+ }
+ >
+
+ >
+ )}
+ {accessStore.provider === ServiceProvider.Anthropic && (
+ <>
+
+
+ accessStore.update(
+ (access) =>
+ (access.anthropicUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) =>
+ (access.anthropicApiKey =
+ e.currentTarget.value),
+ );
+ }}
+ />
+
+
+
+ accessStore.update(
+ (access) =>
+ (access.anthropicApiVersion =
+ e.currentTarget.value),
+ )
+ }
+ >
+
+ >
+ )}
+ >
+ )}
+ >
+ )}
+
+ {!shouldHideBalanceQuery && !clientConfig?.isApp ? (
+
+ {!showUsage || loadingUsage ? (
+
+ ) : (
+ }
+ text={Locale.Settings.Usage.Check}
+ onClick={() => checkUsage(true)}
+ />
+ )}
+
+ ) : null}
+
+
+
+ config.update(
+ (config) => (config.customModels = e.currentTarget.value),
+ )
+ }
+ >
+
- {/* */}
-
- {/**/}
- {/* */}
- {/* */}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.dontShowMaskSplashScreen =*/}
- {/* !e.currentTarget.checked),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
-
- {/* */}
- {/* */}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.hideBuiltinMasks = e.currentTarget.checked),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/*
*/}
-
- {/**/}
- {/* */}
- {/* */}
- {/* updateConfig(*/}
- {/* (config) =>*/}
- {/* (config.disablePromptHint = e.currentTarget.checked),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
-
- {/* */}
- {/* }*/}
- {/* text={Locale.Settings.Prompt.Edit}*/}
- {/* onClick={() => setShowPromptModal(true)}*/}
- {/* />*/}
- {/* */}
- {/*
*/}
-
- {/**/}
- {/* {showAccessCode && (*/}
- {/* */}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) => (access.accessCode = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* */}
- {/* )}*/}
-
- {/* {!accessStore.hideUserApiKey && (*/}
- {/* <>*/}
- {/* {*/}
- {/* // 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 && (*/}
- {/* <>*/}
- {/* */}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.provider = e.target*/}
- {/* .value as ServiceProvider),*/}
- {/* );*/}
- {/* }}*/}
- {/* >*/}
- {/* {Object.entries(ServiceProvider).map(([k, v]) => (*/}
- {/* */}
- {/* {k}*/}
- {/* */}
- {/* ))}*/}
- {/* */}
- {/* */}
-
- {/* {accessStore.provider === "OpenAI" ? (*/}
- {/* <>*/}
- {/* */}
- {/* */}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.openaiUrl = e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/* */}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.openaiApiKey = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* */}
- {/* >*/}
- {/* ) : accessStore.provider === "Azure" ? (*/}
- {/* <>*/}
- {/* */}
- {/* */}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.azureUrl = e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/* */}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.azureApiKey = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* */}
- {/* */}
- {/* */}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.azureApiVersion =*/}
- {/* e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/* >*/}
- {/* ) : accessStore.provider === "Google" ? (*/}
- {/* <>*/}
- {/* */}
- {/* */}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.googleUrl = e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/* */}
- {/* {*/}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.googleApiKey = e.currentTarget.value),*/}
- {/* );*/}
- {/* }}*/}
- {/* />*/}
- {/* */}
- {/* */}
- {/* */}
- {/* accessStore.update(*/}
- {/* (access) =>*/}
- {/* (access.googleApiVersion =*/}
- {/* e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/* >*/}
- {/* ) : null}*/}
- {/* >*/}
- {/* )}*/}
- {/* >*/}
- {/* )}*/}
-
- {/* {!shouldHideBalanceQuery && !clientConfig?.isApp ? (*/}
- {/* */}
- {/* {!showUsage || loadingUsage ? (*/}
- {/*
*/}
- {/* ) : (*/}
- {/* }*/}
- {/* text={Locale.Settings.Usage.Check}*/}
- {/* onClick={() => checkUsage(true)}*/}
- {/* />*/}
- {/* )}*/}
- {/* */}
- {/* ) : null}*/}
-
- {/* */}
- {/* */}
- {/* config.update(*/}
- {/* (config) => (config.customModels = e.currentTarget.value),*/}
- {/* )*/}
- {/* }*/}
- {/* >*/}
- {/* */}
- {/*
*/}
-
- {/**/}
- {/* {*/}
- {/* const modelConfig = { ...config.modelConfig };*/}
- {/* updater(modelConfig);*/}
- {/* config.update((config) => (config.modelConfig = modelConfig));*/}
- {/* }}*/}
- {/* />*/}
- {/*
*/}
+
+ {
+ const modelConfig = { ...config.modelConfig };
+ updater(modelConfig);
+ config.update((config) => (config.modelConfig = modelConfig));
+ }}
+ />
+
{shouldShowPromptModal && (
setShowPromptModal(false)} />
diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx
index d62d2aa91f5..69b2e71f871 100644
--- a/app/components/sidebar.tsx
+++ b/app/components/sidebar.tsx
@@ -6,7 +6,6 @@ import { IconButton } from "./button";
import SettingsIcon from "../icons/settings.svg";
import GithubIcon from "../icons/github.svg";
import ChatGptIcon from "../icons/chatgpt.svg";
-import DiitIcon from "../icons/diit.svg";
import AddIcon from "../icons/add.svg";
import CloseIcon from "../icons/close.svg";
import DeleteIcon from "../icons/delete.svg";
@@ -156,38 +155,38 @@ export function SideBar(props: { className?: string }) {
>
- DiitChat
+ NextChat
+
+
+ Build your own AI assistant.
- {/*
*/}
- {/* Build your own AI assistant.*/}
- {/*
*/}
-
+
- {/**/}
- {/* }*/}
- {/* text={shouldNarrow ? undefined : Locale.Mask.Name}*/}
- {/* className={styles["sidebar-bar-button"]}*/}
- {/* onClick={() => {*/}
- {/* if (config.dontShowMaskSplashScreen !== true) {*/}
- {/* navigate(Path.NewChat, { state: { fromHome: true } });*/}
- {/* } else {*/}
- {/* navigate(Path.Masks, { state: { fromHome: true } });*/}
- {/* }*/}
- {/* }}*/}
- {/* shadow*/}
- {/* />*/}
- {/* }*/}
- {/* text={shouldNarrow ? undefined : Locale.Plugin.Name}*/}
- {/* className={styles["sidebar-bar-button"]}*/}
- {/* onClick={() => showToast(Locale.WIP)}*/}
- {/* shadow*/}
- {/* />*/}
- {/*
*/}
+
+ }
+ text={shouldNarrow ? undefined : Locale.Mask.Name}
+ className={styles["sidebar-bar-button"]}
+ onClick={() => {
+ if (config.dontShowMaskSplashScreen !== true) {
+ navigate(Path.NewChat, { state: { fromHome: true } });
+ } else {
+ navigate(Path.Masks, { state: { fromHome: true } });
+ }
+ }}
+ shadow
+ />
+ }
+ text={shouldNarrow ? undefined : Locale.Plugin.Name}
+ className={styles["sidebar-bar-button"]}
+ onClick={() => showToast(Locale.WIP)}
+ shadow
+ />
+
} shadow />
- {/*
*/}
+
\ No newline at end of file
diff --git a/app/layout.tsx b/app/layout.tsx
index 2a4da630244..5898b21a1fa 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -10,7 +10,7 @@ import { GoogleTagManager } from "@next/third-parties/google";
const serverConfig = getServerSideConfig();
export const metadata: Metadata = {
- title: "DiitChat",
+ title: "NextChat",
description: "Your personal ChatGPT Chat Bot.",
viewport: {
width: "device-width",
@@ -36,10 +36,7 @@ export default function RootLayout({
-
+
diff --git a/app/locales/cn.ts b/app/locales/cn.ts
index ade8618f6f6..2ff94e32d43 100644
--- a/app/locales/cn.ts
+++ b/app/locales/cn.ts
@@ -8,7 +8,7 @@ const cn = {
Error: {
Unauthorized: isApp
? "检测到无效 API Key,请前往[设置](/#/settings)页检查 API Key 是否配置正确。"
- : "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码。",
+ : "访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。",
},
Auth: {
Title: "需要密码",
diff --git a/app/locales/index.ts b/app/locales/index.ts
index d1af83e817e..6e8088a9894 100644
--- a/app/locales/index.ts
+++ b/app/locales/index.ts
@@ -71,9 +71,9 @@ export const ALL_LANG_OPTIONS: Record = {
};
const LANG_KEY = "lang";
-const DEFAULT_LANG = "cn";
+const DEFAULT_LANG = "en";
-const fallbackLang = cn;
+const fallbackLang = en;
const targetLang = ALL_LANGS[getLang()] as LocaleType;
// if target lang missing some fields, it will use fallback lang string
@@ -104,19 +104,19 @@ function getLanguage() {
}
export function getLang(): Lang {
- // const savedLang = getItem(LANG_KEY);
- //
- // if (AllLangs.includes((savedLang ?? "") as Lang)) {
- // return savedLang as Lang;
- // }
- //
- // const lang = getLanguage();
- //
- // for (const option of AllLangs) {
- // if (lang.includes(option)) {
- // return option;
- // }
- // }
+ const savedLang = getItem(LANG_KEY);
+
+ if (AllLangs.includes((savedLang ?? "") as Lang)) {
+ return savedLang as Lang;
+ }
+
+ const lang = getLanguage();
+
+ for (const option of AllLangs) {
+ if (lang.includes(option)) {
+ return option;
+ }
+ }
return DEFAULT_LANG;
}
diff --git a/app/masks/index.ts b/app/masks/index.ts
index c17f925e826..aa4917e3e3c 100644
--- a/app/masks/index.ts
+++ b/app/masks/index.ts
@@ -22,8 +22,6 @@ export const BUILTIN_MASK_STORE = {
},
};
-export const BUILTIN_MASKS: BuiltinMask[] = [
- ...CN_MASKS,
- ...TW_MASKS,
- ...EN_MASKS,
-].map((m) => BUILTIN_MASK_STORE.add(m));
+export const BUILTIN_MASKS: BuiltinMask[] = [...CN_MASKS, ...TW_MASKS, ...EN_MASKS].map(
+ (m) => BUILTIN_MASK_STORE.add(m),
+);
diff --git a/app/store/config.ts b/app/store/config.ts
index ea07ceb0b5c..94cfcd8ecaa 100644
--- a/app/store/config.ts
+++ b/app/store/config.ts
@@ -33,14 +33,14 @@ export const DEFAULT_CONFIG = {
avatar: "1f603",
fontSize: 14,
theme: Theme.Auto as Theme,
- tightBorder: !!getClientConfig()?.isApp,
- sendPreviewBubble: false,
+ tightBorder: !!config?.isApp,
+ sendPreviewBubble: true,
enableAutoGenerateTitle: true,
sidebarWidth: DEFAULT_SIDEBAR_WIDTH,
disablePromptHint: false,
- dontShowMaskSplashScreen: true, // dont show splash screen when create chat
+ dontShowMaskSplashScreen: false, // dont show splash screen when create chat
hideBuiltinMasks: false, // dont add builtin masks
customModels: "",
diff --git a/app/store/sync.ts b/app/store/sync.ts
index 77f7b9cddf5..d3582e3c935 100644
--- a/app/store/sync.ts
+++ b/app/store/sync.ts
@@ -100,17 +100,15 @@ export const useSyncStore = createPersistStore(
const remoteState = await client.get(config.username);
if (!remoteState || remoteState === "") {
await client.set(config.username, JSON.stringify(localState));
- console.log(
- "[Sync] Remote state is empty, using local state instead.",
- );
- return;
+ console.log("[Sync] Remote state is empty, using local state instead.");
+ return
} else {
const parsedRemoteState = JSON.parse(
await client.get(config.username),
) as AppState;
mergeAppState(localState, parsedRemoteState);
setLocalAppState(localState);
- }
+ }
} catch (e) {
console.log("[Sync] failed to get remote state", e);
throw e;
diff --git a/package.json b/package.json
index 33ce4086420..4d06b0b14e4 100644
--- a/package.json
+++ b/package.json
@@ -65,5 +65,5 @@
"resolutions": {
"lint-staged/yaml": "^2.2.2"
},
- "version": "0.0.0"
+ "packageManager": "yarn@1.22.19"
}
diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png
index 700c48286da..797a7d86af0 100644
Binary files a/public/android-chrome-192x192.png and b/public/android-chrome-192x192.png differ
diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png
index e701ed2fb5f..c0265ef4f88 100644
Binary files a/public/android-chrome-512x512.png and b/public/android-chrome-512x512.png differ
diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png
index 38730311410..6461c47c206 100644
Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ
diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png
index 92f53492fd3..3f8e0a5359f 100644
Binary files a/public/favicon-16x16.png and b/public/favicon-16x16.png differ
diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png
index f1f439e856d..c464762ea2a 100644
Binary files a/public/favicon-32x32.png and b/public/favicon-32x32.png differ
diff --git a/public/favicon.ico b/public/favicon.ico
index a3737b350cd..b5e8234cd0b 100644
Binary files a/public/favicon.ico and b/public/favicon.ico differ
diff --git a/public/macos.png b/public/macos.png
index f1bd0e69f41..4ca110e373e 100644
Binary files a/public/macos.png and b/public/macos.png differ
diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png
index 7fee8db6e73..445c65313e0 100644
Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ
diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png
index 178761b6a7b..c1a51d41fb5 100644
Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ
diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png
index 471cdbb6558..e06e30c4c20 100644
Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ
diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png
index 241e101ba8f..10327629022 100644
Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ
diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png
index b27ce753da8..fe38d992546 100644
Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ
diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png
index d9d58df2d3a..78c1e072258 100644
Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ
diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png
index 64dd15d81f8..a3b0afca3b3 100644
Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ
diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png
index c585069dbc0..9adabd622f6 100644
Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ
diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png
index 70b0b5ddb82..5d5eabec697 100644
Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ
diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png
index 6657a961708..8e3b2781656 100644
Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ
diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png
index 865a99ed856..e8a2d095d41 100644
Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ
diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png
index 4be7164307f..77e9a89720e 100644
Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ
diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png
index 9791b7adbab..0b98f3c579e 100644
Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ
diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns
index 7432486f725..131a0810a0c 100644
Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ
diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico
index 59f1568eeae..93e6e8af24d 100644
Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ
diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png
index 3ae7ae9bfd8..c0265ef4f88 100644
Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ