mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
opt: remove redundant code
This commit is contained in:
parent
556e3ce935
commit
1022c3ef06
@ -288,18 +288,6 @@ export function Chat(props: {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmEdit = (index: number) => {
|
|
||||||
chatStore.onConfirmEdit(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
const cancelEdit = (message: Message) => {
|
|
||||||
chatStore.onCancelEdit(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
const onEdit = (message: Message) => {
|
|
||||||
chatStore.onUserEdit(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for auto-scroll
|
// for auto-scroll
|
||||||
const latestMessageRef = useRef<HTMLDivElement>(null);
|
const latestMessageRef = useRef<HTMLDivElement>(null);
|
||||||
const [autoScroll, setAutoScroll] = useState(true);
|
const [autoScroll, setAutoScroll] = useState(true);
|
||||||
@ -490,7 +478,7 @@ export function Chat(props: {
|
|||||||
<div className={styles["chat-message-bottom-actions"]}>
|
<div className={styles["chat-message-bottom-actions"]}>
|
||||||
<div
|
<div
|
||||||
className={styles["chat-message-bottom-action"]}
|
className={styles["chat-message-bottom-action"]}
|
||||||
onClick={() => onEdit(message)}>
|
onClick={() => chatStore.onUserEdit(message)}>
|
||||||
{Locale.Chat.Actions.Edit}
|
{Locale.Chat.Actions.Edit}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -507,13 +495,13 @@ export function Chat(props: {
|
|||||||
<div style={{display: "flex"}}>
|
<div style={{display: "flex"}}>
|
||||||
<div
|
<div
|
||||||
className={styles["chat-message-action-edit"]}
|
className={styles["chat-message-action-edit"]}
|
||||||
onClick={() => confirmEdit(i)}>
|
onClick={() => chatStore.onConfirmEdit(i)}>
|
||||||
{Locale.Chat.Actions.Confirm}
|
{Locale.Chat.Actions.Confirm}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={styles["chat-message-action-edit"]}
|
className={styles["chat-message-action-edit"]}
|
||||||
onClick={() => cancelEdit(message)}>
|
onClick={() => chatStore.onCancelEdit(message)}>
|
||||||
{Locale.Chat.Actions.Cancel}
|
{Locale.Chat.Actions.Cancel}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user