fix: Address code review feedback - deprecated substr, chatQuick timing
Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/6138ad64-32ec-4191-9730-de0bf24e87a8 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
f3ed7ea602
commit
1ea9944f72
|
|
@ -2389,7 +2389,7 @@ function saveConversations(){
|
||||||
if(activeConvId)try{localStorage.setItem(HL_ACTIVE_CONV,activeConvId)}catch(e){}
|
if(activeConvId)try{localStorage.setItem(HL_ACTIVE_CONV,activeConvId)}catch(e){}
|
||||||
}
|
}
|
||||||
function newConversation(){
|
function newConversation(){
|
||||||
var id='conv-'+Date.now()+'-'+Math.random().toString(36).substr(2,4);
|
var id='conv-'+Date.now()+'-'+Math.random().toString(36).slice(2,6);
|
||||||
var conv={id:id,title:'新对话',messages:[],created:new Date().toISOString(),updated:new Date().toISOString()};
|
var conv={id:id,title:'新对话',messages:[],created:new Date().toISOString(),updated:new Date().toISOString()};
|
||||||
conversations.unshift(conv);
|
conversations.unshift(conv);
|
||||||
activeConvId=id;
|
activeConvId=id;
|
||||||
|
|
@ -3400,8 +3400,12 @@ function renderWorkspace(){
|
||||||
window.chatQuick = function(cmd){
|
window.chatQuick = function(cmd){
|
||||||
chatIn.value = cmd;
|
chatIn.value = cmd;
|
||||||
// Navigate to home to show chat if on another page
|
// Navigate to home to show chat if on another page
|
||||||
if(currentPage!=='home'){go('home')}
|
if(currentPage!=='home'){
|
||||||
send();
|
go('home');
|
||||||
|
setTimeout(function(){send()},600);
|
||||||
|
}else{
|
||||||
|
send();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ════════════════════════════════════════
|
/* ════════════════════════════════════════
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue