From 54bd07702c5b8e61dc52524cdc8aa3bc82a97170 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Wed, 5 Jul 2023 22:39:25 +0800 Subject: [PATCH] refactor: #2256 hide builtin masks --- app/components/settings.tsx | 4 ++-- app/locales/ar.ts | 4 ---- app/locales/cn.ts | 4 ++-- app/locales/cs.ts | 4 ---- app/locales/de.ts | 4 ---- app/locales/en.ts | 4 ++-- app/locales/es.ts | 4 ---- app/locales/fr.ts | 4 ---- app/locales/it.ts | 4 ---- app/locales/jp.ts | 4 ---- app/locales/ko.ts | 4 ---- app/locales/ru.ts | 4 ---- app/locales/tr.ts | 4 ---- app/locales/tw.ts | 4 ---- app/locales/vi.ts | 4 ---- app/store/config.ts | 7 ++++--- app/store/mask.ts | 2 +- 17 files changed, 11 insertions(+), 58 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index ca971309..5980a34e 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -568,11 +568,11 @@ export function Settings() { > updateConfig( (config) => - (config.dontAddBuiltinMasks = !e.currentTarget.checked), + (config.hideBuiltinMasks = e.currentTarget.checked), ) } > diff --git a/app/locales/ar.ts b/app/locales/ar.ts index dfdca9d7..b3b5c021 100644 --- a/app/locales/ar.ts +++ b/app/locales/ar.ts @@ -134,10 +134,6 @@ const ar: PartialLocaleType = { Title: "شاشة تظهر الأقنعة", SubTitle: "عرض شاشة تظهر الأقنعة قبل بدء الدردشة الجديدة", }, - Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", - }, }, Prompt: { Disable: { diff --git a/app/locales/cn.ts b/app/locales/cn.ts index c1a21da3..6c8b6c0a 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -161,8 +161,8 @@ const cn = { SubTitle: "新建聊天时,展示面具启动页", }, Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", + Title: "隐藏内置面具", + SubTitle: "在所有面具列表中隐藏内置面具", }, }, Prompt: { diff --git a/app/locales/cs.ts b/app/locales/cs.ts index d4d5e055..348e16af 100644 --- a/app/locales/cs.ts +++ b/app/locales/cs.ts @@ -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: { diff --git a/app/locales/de.ts b/app/locales/de.ts index 708fe3ec..d7e88cc8 100644 --- a/app/locales/de.ts +++ b/app/locales/de.ts @@ -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: { diff --git a/app/locales/en.ts b/app/locales/en.ts index 930b9f44..ab489c25 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -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: { diff --git a/app/locales/es.ts b/app/locales/es.ts index d578c3e7..0971f05c 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -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: { diff --git a/app/locales/fr.ts b/app/locales/fr.ts index 57f11406..72be76e1 100644 --- a/app/locales/fr.ts +++ b/app/locales/fr.ts @@ -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: { diff --git a/app/locales/it.ts b/app/locales/it.ts index dafb5cce..acd3a7e9 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -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: { diff --git a/app/locales/jp.ts b/app/locales/jp.ts index 42ec6aab..090a428f 100644 --- a/app/locales/jp.ts +++ b/app/locales/jp.ts @@ -108,10 +108,6 @@ const jp: PartialLocaleType = { Title: "キャラクターページ", SubTitle: "新規チャット作成時にキャラクターページを表示する", }, - Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", - }, }, Prompt: { Disable: { diff --git a/app/locales/ko.ts b/app/locales/ko.ts index 0a3ec823..6f5ec7a9 100644 --- a/app/locales/ko.ts +++ b/app/locales/ko.ts @@ -91,10 +91,6 @@ const ko: PartialLocaleType = { Title: "마스크 시작 화면", SubTitle: "새로운 채팅 시작 전에 마스크 시작 화면 표시", }, - Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", - }, }, Prompt: { Disable: { diff --git a/app/locales/ru.ts b/app/locales/ru.ts index f3398d68..06c94585 100644 --- a/app/locales/ru.ts +++ b/app/locales/ru.ts @@ -91,10 +91,6 @@ const ru: PartialLocaleType = { Title: "Экран заставки маски", SubTitle: "Показывать экран заставки маски перед началом нового чата", }, - Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", - }, }, Prompt: { Disable: { diff --git a/app/locales/tr.ts b/app/locales/tr.ts index e1a0c4d7..2383a549 100644 --- a/app/locales/tr.ts +++ b/app/locales/tr.ts @@ -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: { diff --git a/app/locales/tw.ts b/app/locales/tw.ts index 9282acd5..1afb0eb7 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -89,10 +89,6 @@ const tw: PartialLocaleType = { Title: "面具启动页", SubTitle: "新建聊天时,展示面具启动页", }, - Builtin: { - Title: "Show Builtin Masks", - SubTitle: "Show builtin masks in mask list", - }, }, Prompt: { Disable: { diff --git a/app/locales/vi.ts b/app/locales/vi.ts index f345d8c7..428f9385 100644 --- a/app/locales/vi.ts +++ b/app/locales/vi.ts @@ -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: { diff --git a/app/store/config.ts b/app/store/config.ts index 493a3687..fee009c0 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -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()( }), { 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()( state.modelConfig.top_p = 1; state.modelConfig.template = DEFAULT_INPUT_TEMPLATE; state.dontShowMaskSplashScreen = false; + state.hideBuiltinMasks = false; return state; }, diff --git a/app/store/mask.ts b/app/store/mask.ts index 57e1b667..d5540052 100644 --- a/app/store/mask.ts +++ b/app/store/mask.ts @@ -90,7 +90,7 @@ export const useMaskStore = create()( (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) => ({