mirror of
https://github.com/Yanyutin753/ChatGPT-Next-Web-LangChain-Gpt-4-All.git
synced 2025-10-13 22:57:24 +00:00
fix chat.tsx
This commit is contained in:
@@ -373,17 +373,17 @@ function ChatAction(props: {
|
|||||||
style={
|
style={
|
||||||
props.icon && !props.loding
|
props.icon && !props.loding
|
||||||
? ({
|
? ({
|
||||||
"--icon-width": `${width.icon}px`,
|
"--icon-width": `${width.icon}px`,
|
||||||
"--full-width": `${width.full}px`,
|
"--full-width": `${width.full}px`,
|
||||||
...props.style,
|
...props.style,
|
||||||
} as React.CSSProperties)
|
} as React.CSSProperties)
|
||||||
: props.loding
|
: props.loding
|
||||||
? ({
|
? ({
|
||||||
"--icon-width": `30px`,
|
"--icon-width": `30px`,
|
||||||
"--full-width": `30px`,
|
"--full-width": `30px`,
|
||||||
...props.style,
|
...props.style,
|
||||||
} as React.CSSProperties)
|
} as React.CSSProperties)
|
||||||
: props.style
|
: props.style
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{props.icon ? (
|
{props.icon ? (
|
||||||
@@ -609,7 +609,7 @@ export function ChatActions(props: {
|
|||||||
|
|
||||||
{config.pluginConfig.enable &&
|
{config.pluginConfig.enable &&
|
||||||
/^gpt(?!.*03\d{2}$).*$/.test(currentModel) &&
|
/^gpt(?!.*03\d{2}$).*$/.test(currentModel) &&
|
||||||
!currentModel.includes("vision") && (
|
currentModel != "gpt-4-vision-preview" && (
|
||||||
<ChatAction
|
<ChatAction
|
||||||
onClick={switchUsePlugins}
|
onClick={switchUsePlugins}
|
||||||
text={
|
text={
|
||||||
@@ -623,13 +623,13 @@ export function ChatActions(props: {
|
|||||||
{currentModel.includes("vision") && (
|
{currentModel.includes("vision") && (
|
||||||
<ChatAction
|
<ChatAction
|
||||||
onClick={selectImage}
|
onClick={selectImage}
|
||||||
text="选择文档"
|
text="选择图片"
|
||||||
loding={uploadLoading}
|
loding={uploadLoading}
|
||||||
icon={<UploadIcon />}
|
icon={<UploadIcon />}
|
||||||
innerNode={
|
innerNode={
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
accept="*/*"
|
accept=".png,.jpg,.webp,.jpeg"
|
||||||
id="chat-image-file-select-upload"
|
id="chat-image-file-select-upload"
|
||||||
style={{ display: "none" }}
|
style={{ display: "none" }}
|
||||||
onChange={onImageSelected}
|
onChange={onImageSelected}
|
||||||
@@ -1031,28 +1031,28 @@ function _Chat() {
|
|||||||
.concat(
|
.concat(
|
||||||
isLoading
|
isLoading
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
...createMessage({
|
...createMessage({
|
||||||
role: "assistant",
|
role: "assistant",
|
||||||
content: "……",
|
content: "……",
|
||||||
}),
|
}),
|
||||||
preview: true,
|
preview: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
)
|
)
|
||||||
.concat(
|
.concat(
|
||||||
userInput.length > 0 && config.sendPreviewBubble
|
userInput.length > 0 && config.sendPreviewBubble
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
...createMessage({
|
...createMessage({
|
||||||
role: "user",
|
role: "user",
|
||||||
content: userInput,
|
content: userInput,
|
||||||
image_url: userImage?.fileUrl,
|
image_url: userImage?.fileUrl,
|
||||||
}),
|
}),
|
||||||
preview: true,
|
preview: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
);
|
);
|
||||||
}, [
|
}, [
|
||||||
@@ -1149,7 +1149,7 @@ function _Chat() {
|
|||||||
if (payload.key || payload.url) {
|
if (payload.key || payload.url) {
|
||||||
showConfirm(
|
showConfirm(
|
||||||
Locale.URLCommand.Settings +
|
Locale.URLCommand.Settings +
|
||||||
`\n${JSON.stringify(payload, null, 4)}`,
|
`\n${JSON.stringify(payload, null, 4)}`,
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
if (!res) return;
|
if (!res) return;
|
||||||
if (payload.key) {
|
if (payload.key) {
|
||||||
@@ -1412,7 +1412,7 @@ function _Chat() {
|
|||||||
defaultShow={i >= messages.length - 6}
|
defaultShow={i >= messages.length - 6}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{!isUser && message?.model?.includes("vision") && (
|
{!isUser && message.model?.includes("vision") && (
|
||||||
<div
|
<div
|
||||||
className={[
|
className={[
|
||||||
styles["chat-message-actions"],
|
styles["chat-message-actions"],
|
||||||
|
Reference in New Issue
Block a user