feat: #112 add edit chat title

This commit is contained in:
Yifei Zhang
2023-03-29 16:02:50 +00:00
parent 08f3c7026d
commit 45088a3e06
7 changed files with 40 additions and 14 deletions

View File

@@ -333,7 +333,17 @@ export function Chat(props: {
className={styles["window-header-title"]}
onClick={props?.showSideBar}
>
<div className={styles["window-header-main-title"]}>
<div
className={`${styles["window-header-main-title"]} ${styles["chat-body-title"]}`}
onClick={() => {
const newTopic = prompt(Locale.Chat.Rename, session.topic);
if (newTopic && newTopic !== session.topic) {
chatStore.updateCurrentSession(
(session) => (session.topic = newTopic!),
);
}
}}
>
{session.topic}
</div>
<div className={styles["window-header-sub-title"]}>