Add files via upload

This commit is contained in:
公明
2026-07-22 21:01:56 +08:00
committed by GitHub
parent d9cb0b11c5
commit 93ab362b6f
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -4532,6 +4532,10 @@ async function loadConversation(conversationId) {
// 更新当前对话ID
currentConversationId = conversationId;
window._loadedConversationProjectId = conversation.projectId || conversation.project_id || '';
const conversationRoleName = conversation.roleName || conversation.role_name || '';
if (typeof window.setCurrentRole === 'function') {
window.setCurrentRole(conversationRoleName || '默认');
}
try {
window.currentConversationId = conversationId;
} catch (e) { /* ignore */ }
+2
View File
@@ -1892,6 +1892,7 @@ function getCurrentRole() {
// 暴露函数到全局作用域
if (typeof window !== 'undefined') {
window.getCurrentRole = getCurrentRole;
window.setCurrentRole = handleRoleChange;
window.toggleRoleSelectionPanel = toggleRoleSelectionPanel;
window.closeRoleSelectionPanel = closeRoleSelectionPanel;
window.closeRoleSelectModal = closeRoleSelectModal;
@@ -1905,6 +1906,7 @@ if (typeof window !== 'undefined') {
originalHandleRoleChange(roleName);
if (typeof window !== 'undefined') {
window.currentSelectedRole = getCurrentRole();
window.setCurrentRole = handleRoleChange;
}
};
}