forked from XiaoMo/ChatGPT-Next-Web
feat: close #1626 hide context prompts in mask config
This commit is contained in:
parent
af497c96ec
commit
6d8c7ba140
@ -585,7 +585,9 @@ export function Chat() {
|
|||||||
inputRef.current?.focus();
|
inputRef.current?.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
const context: RenderMessage[] = session.mask.context.slice();
|
const context: RenderMessage[] = session.mask.hideContext
|
||||||
|
? []
|
||||||
|
: session.mask.context.slice();
|
||||||
|
|
||||||
const accessStore = useAccessStore();
|
const accessStore = useAccessStore();
|
||||||
|
|
||||||
|
@ -104,25 +104,41 @@ export function MaskConfig(props: {
|
|||||||
></input>
|
></input>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem
|
<ListItem
|
||||||
title={Locale.Mask.Config.Sync.Title}
|
title={Locale.Mask.Config.HideContext.Title}
|
||||||
subTitle={Locale.Mask.Config.Sync.SubTitle}
|
subTitle={Locale.Mask.Config.HideContext.SubTitle}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={props.mask.syncGlobalConfig}
|
checked={props.mask.hideContext}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (
|
props.updateMask((mask) => {
|
||||||
e.currentTarget.checked &&
|
mask.hideContext = e.currentTarget.checked;
|
||||||
confirm(Locale.Mask.Config.Sync.Confirm)
|
});
|
||||||
) {
|
|
||||||
props.updateMask((mask) => {
|
|
||||||
mask.syncGlobalConfig = e.currentTarget.checked;
|
|
||||||
mask.modelConfig = { ...globalConfig.modelConfig };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
></input>
|
></input>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
{props.shouldSyncFromGlobal ? (
|
||||||
|
<ListItem
|
||||||
|
title={Locale.Mask.Config.Sync.Title}
|
||||||
|
subTitle={Locale.Mask.Config.Sync.SubTitle}
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={props.mask.syncGlobalConfig}
|
||||||
|
onChange={(e) => {
|
||||||
|
if (
|
||||||
|
e.currentTarget.checked &&
|
||||||
|
confirm(Locale.Mask.Config.Sync.Confirm)
|
||||||
|
) {
|
||||||
|
props.updateMask((mask) => {
|
||||||
|
mask.syncGlobalConfig = e.currentTarget.checked;
|
||||||
|
mask.modelConfig = { ...globalConfig.modelConfig };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
></input>
|
||||||
|
</ListItem>
|
||||||
|
) : null}
|
||||||
</List>
|
</List>
|
||||||
|
|
||||||
<List>
|
<List>
|
||||||
|
@ -210,6 +210,10 @@ const cn = {
|
|||||||
SubTitle: "当前对话是否使用全局模型设置",
|
SubTitle: "当前对话是否使用全局模型设置",
|
||||||
Confirm: "当前对话的自定义设置将会被自动覆盖,确认启用全局设置?",
|
Confirm: "当前对话的自定义设置将会被自动覆盖,确认启用全局设置?",
|
||||||
},
|
},
|
||||||
|
HideContext: {
|
||||||
|
Title: "隐藏预设对话",
|
||||||
|
SubTitle: "隐藏后预设对话不会出现在聊天界面",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
NewChat: {
|
NewChat: {
|
||||||
|
@ -213,6 +213,10 @@ const en: RequiredLocaleType = {
|
|||||||
SubTitle: "Use global config in this chat",
|
SubTitle: "Use global config in this chat",
|
||||||
Confirm: "Confirm to override custom config with global config?",
|
Confirm: "Confirm to override custom config with global config?",
|
||||||
},
|
},
|
||||||
|
HideContext: {
|
||||||
|
Title: "Hide Context Prompts",
|
||||||
|
SubTitle: "Do not show in-context prompts in chat",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
NewChat: {
|
NewChat: {
|
||||||
@ -221,7 +225,7 @@ const en: RequiredLocaleType = {
|
|||||||
Title: "Pick a Mask",
|
Title: "Pick a Mask",
|
||||||
SubTitle: "Chat with the Soul behind the Mask",
|
SubTitle: "Chat with the Soul behind the Mask",
|
||||||
More: "Find More",
|
More: "Find More",
|
||||||
NotShow: "Not Show Again",
|
NotShow: "Dont Show Again",
|
||||||
ConfirmNoShow: "Confirm to disable?You can enable it in settings later.",
|
ConfirmNoShow: "Confirm to disable?You can enable it in settings later.",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ export type Mask = {
|
|||||||
id: number;
|
id: number;
|
||||||
avatar: string;
|
avatar: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
hideContext?: boolean;
|
||||||
context: ChatMessage[];
|
context: ChatMessage[];
|
||||||
syncGlobalConfig?: boolean;
|
syncGlobalConfig?: boolean;
|
||||||
modelConfig: ModelConfig;
|
modelConfig: ModelConfig;
|
||||||
|
Loading…
Reference in New Issue
Block a user