mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 03:26:38 +08:00
Add Quick NewChat Action
This commit is contained in:
parent
cc0eae7153
commit
2b5fbb7f18
@ -37,6 +37,7 @@ import AutoIcon from "../icons/auto.svg";
|
|||||||
import BottomIcon from "../icons/bottom.svg";
|
import BottomIcon from "../icons/bottom.svg";
|
||||||
import StopIcon from "../icons/pause.svg";
|
import StopIcon from "../icons/pause.svg";
|
||||||
import RobotIcon from "../icons/robot.svg";
|
import RobotIcon from "../icons/robot.svg";
|
||||||
|
import AddIcon from "../icons/add.svg";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ChatMessage,
|
ChatMessage,
|
||||||
@ -97,6 +98,8 @@ import { ExportMessageModal } from "./exporter";
|
|||||||
import { getClientConfig } from "../config/client";
|
import { getClientConfig } from "../config/client";
|
||||||
import { useAllModels } from "../utils/hooks";
|
import { useAllModels } from "../utils/hooks";
|
||||||
import { MultimodalContent } from "../client/api";
|
import { MultimodalContent } from "../client/api";
|
||||||
|
import { InputRange } from "./input-range";
|
||||||
|
import { config } from "process";
|
||||||
|
|
||||||
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
|
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
|
||||||
loading: () => <LoadingIcon />,
|
loading: () => <LoadingIcon />,
|
||||||
@ -555,6 +558,15 @@ export function ChatActions(props: {
|
|||||||
icon={<RobotIcon />}
|
icon={<RobotIcon />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ChatAction
|
||||||
|
text={Locale.Chat.InputActions.NewChat}
|
||||||
|
icon={<AddIcon />}
|
||||||
|
onClick={() => {
|
||||||
|
chatStore.newSession(chatStore.currentSession().mask);
|
||||||
|
navigate(Path.Chat);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{showModelSelector && (
|
{showModelSelector && (
|
||||||
<Selector
|
<Selector
|
||||||
defaultSelectedValue={currentModel}
|
defaultSelectedValue={currentModel}
|
||||||
@ -1100,11 +1112,13 @@ function _Chat() {
|
|||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handlePaste = useCallback(
|
const handlePaste = useCallback(
|
||||||
async (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
|
async (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
|
||||||
const currentModel = chatStore.currentSession().mask.modelConfig.model;
|
const currentModel = chatStore.currentSession().mask.modelConfig.model;
|
||||||
if(!isVisionModel(currentModel)){return;}
|
if (!isVisionModel(currentModel)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const items = (event.clipboardData || window.clipboardData).items;
|
const items = (event.clipboardData || window.clipboardData).items;
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (item.kind === "file" && item.type.startsWith("image/")) {
|
if (item.kind === "file" && item.type.startsWith("image/")) {
|
||||||
|
@ -62,6 +62,7 @@ const cn = {
|
|||||||
Prompt: "快捷指令",
|
Prompt: "快捷指令",
|
||||||
Masks: "所有面具",
|
Masks: "所有面具",
|
||||||
Clear: "清除聊天",
|
Clear: "清除聊天",
|
||||||
|
NewChat: "另起聊天",
|
||||||
Settings: "对话设置",
|
Settings: "对话设置",
|
||||||
UploadImage: "上传图片",
|
UploadImage: "上传图片",
|
||||||
},
|
},
|
||||||
|
@ -64,6 +64,7 @@ const en: LocaleType = {
|
|||||||
Prompt: "Prompts",
|
Prompt: "Prompts",
|
||||||
Masks: "Masks",
|
Masks: "Masks",
|
||||||
Clear: "Clear Context",
|
Clear: "Clear Context",
|
||||||
|
NewChat: "New Chat",
|
||||||
Settings: "Settings",
|
Settings: "Settings",
|
||||||
UploadImage: "Upload Images",
|
UploadImage: "Upload Images",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user