refactor: #2256 hide builtin masks

This commit is contained in:
Yidadaa 2023-07-05 22:39:25 +08:00
parent a75e2b0c0e
commit 54bd07702c
17 changed files with 11 additions and 58 deletions

View File

@ -568,11 +568,11 @@ export function Settings() {
>
<input
type="checkbox"
checked={!config.dontAddBuiltinMasks}
checked={config.hideBuiltinMasks}
onChange={(e) =>
updateConfig(
(config) =>
(config.dontAddBuiltinMasks = !e.currentTarget.checked),
(config.hideBuiltinMasks = e.currentTarget.checked),
)
}
></input>

View File

@ -134,10 +134,6 @@ const ar: PartialLocaleType = {
Title: "شاشة تظهر الأقنعة",
SubTitle: "عرض شاشة تظهر الأقنعة قبل بدء الدردشة الجديدة",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -161,8 +161,8 @@ const cn = {
SubTitle: "新建聊天时,展示面具启动页",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
Title: "隐藏内置面具",
SubTitle: "在所有面具列表中隐藏内置面具",
},
},
Prompt: {

View File

@ -91,10 +91,6 @@ const cs: PartialLocaleType = {
Title: "Úvodní obrazovka Masek",
SubTitle: "Před zahájením nového chatu zobrazte úvodní obrazovku Masek",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const de: PartialLocaleType = {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -162,8 +162,8 @@ const en: LocaleType = {
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
Title: "Hide Builtin Masks",
SubTitle: "Hide builtin masks in mask list",
},
},
Prompt: {

View File

@ -91,10 +91,6 @@ const es: PartialLocaleType = {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -93,10 +93,6 @@ const fr: PartialLocaleType = {
SubTitle:
"Afficher un écran de masque avant de démarrer une nouvelle discussion",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const it: PartialLocaleType = {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -108,10 +108,6 @@ const jp: PartialLocaleType = {
Title: "キャラクターページ",
SubTitle: "新規チャット作成時にキャラクターページを表示する",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const ko: PartialLocaleType = {
Title: "마스크 시작 화면",
SubTitle: "새로운 채팅 시작 전에 마스크 시작 화면 표시",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const ru: PartialLocaleType = {
Title: "Экран заставки маски",
SubTitle: "Показывать экран заставки маски перед началом нового чата",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const tr: PartialLocaleType = {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -89,10 +89,6 @@ const tw: PartialLocaleType = {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -91,10 +91,6 @@ const vi: PartialLocaleType = {
Title: "Mask Splash Screen",
SubTitle: "Chớp màn hình khi bắt đầu cuộc trò chuyện mới",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {

View File

@ -32,7 +32,7 @@ export const DEFAULT_CONFIG = {
disablePromptHint: false,
dontShowMaskSplashScreen: false, // dont show splash screen when create chat
dontAddBuiltinMasks: false, // dont add builtin masks
hideBuiltinMasks: false, // dont add builtin masks
models: DEFAULT_MODELS as any as LLMModel[],
@ -137,9 +137,9 @@ export const useAppConfig = create<ChatConfigStore>()(
}),
{
name: StoreKey.Config,
version: 3.3,
version: 3.4,
migrate(persistedState, version) {
if (version === 3.3) return persistedState as any;
if (version === 3.4) return persistedState as any;
const state = persistedState as ChatConfig;
state.modelConfig.sendMemory = true;
@ -149,6 +149,7 @@ export const useAppConfig = create<ChatConfigStore>()(
state.modelConfig.top_p = 1;
state.modelConfig.template = DEFAULT_INPUT_TEMPLATE;
state.dontShowMaskSplashScreen = false;
state.hideBuiltinMasks = false;
return state;
},

View File

@ -90,7 +90,7 @@ export const useMaskStore = create<MaskStore>()(
(a, b) => b.id - a.id,
);
const config = useAppConfig.getState();
if (config.dontAddBuiltinMasks) return userMasks;
if (config.hideBuiltinMasks) return userMasks;
const buildinMasks = BUILTIN_MASKS.map(
(m) =>
({