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:
copilot-swe-agent[bot] 2026-04-12 09:25:44 +00:00 committed by GitHub
parent f3ed7ea602
commit 1ea9944f72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -2389,7 +2389,7 @@ function saveConversations(){
if(activeConvId)try{localStorage.setItem(HL_ACTIVE_CONV,activeConvId)}catch(e){}
}
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()};
conversations.unshift(conv);
activeConvId=id;
@ -3400,8 +3400,12 @@ function renderWorkspace(){
window.chatQuick = function(cmd){
chatIn.value = cmd;
// Navigate to home to show chat if on another page
if(currentPage!=='home'){go('home')}
send();
if(currentPage!=='home'){
go('home');
setTimeout(function(){send()},600);
}else{
send();
}
};
/* ════════════════════════════════════════