Compare commits
3 Commits
v2.1.3
...
85dd206154
| Author | SHA1 | Date | |
|---|---|---|---|
| 85dd206154 | |||
| 1b9bb1090c | |||
| 2373040b04 |
@@ -467,11 +467,6 @@
|
|||||||
if (nextBtn) nextBtn.disabled = currentIndex === versions.length - 1;
|
if (nextBtn) nextBtn.disabled = currentIndex === versions.length - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const prevBtn = indicator.parentElement.querySelector('[data-dir="prev"]');
|
|
||||||
const nextBtn = indicator.parentElement.querySelector('[data-dir="next"]');
|
|
||||||
if (prevBtn) prevBtn.disabled = currentIndex === 0;
|
|
||||||
if (nextBtn) nextBtn.disabled = currentIndex === versions.length - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换版本
|
// 切换版本
|
||||||
function switchVersion(messageId, direction) {
|
function switchVersion(messageId, direction) {
|
||||||
@@ -649,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