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

@@ -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) =>
({