Compare commits
2 Commits
2373040b04
...
v2.1.6
| Author | SHA1 | Date | |
|---|---|---|---|
| 85dd206154 | |||
| 1b9bb1090c |
@@ -644,6 +644,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createNewConversation() {
|
async function createNewConversation() {
|
||||||
|
// 检查是否已经是新建对话状态(无对话ID且无消息)
|
||||||
|
const container = document.getElementById('messagesContainer');
|
||||||
|
const hasMessages = container.querySelectorAll('.message').length > 0;
|
||||||
|
|
||||||
|
// 如果当前没有对话ID且没有消息,则不创建新对话
|
||||||
|
if (!currentConversationId && !hasMessages) {
|
||||||
|
return; // 已经是新建对话状态,无需创建
|
||||||
|
}
|
||||||
|
|
||||||
const res = await fetch('/api/conversations', { method: 'POST' });
|
const res = await fetch('/api/conversations', { method: 'POST' });
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
currentConversationId = data.id;
|
currentConversationId = data.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user