Commit 785d75bc authored by chenghong_tao's avatar chenghong_tao

fix history rename

parent a1a53d56
......@@ -134,14 +134,22 @@ const openEdit = (id) => {
ElMessageBox.prompt("", "修改会话名称", {
confirmButtonText: "保存",
cancelButtonText: "取消",
// inputPattern:
// /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
// inputErrorMessage: "Invalid Email",
inputPattern: /\S/,
inputErrorMessage: '会话名称不能为空',
inputPlaceholder: "请输入新的会话名称",
})
.then(async ({ value }) => {
await difyApi.renameChat(id, { name: value });
getHistoryList();
.then(async ({value}) => {
if (!value) {
ElMessage.error("会话名称不能为空");
return false; // Prevent the dialog from closing
}
try {
await difyApi.renameChat(id, { name: value });
getHistoryList();
} catch (error) {
console.error("Failed to rename chat:", error);
ElMessage.error("重命名会话失败");
}
})
.catch(() => {
console.log("取消修改");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment