mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-22 10:57:27 +02:00
修复多会话任务栏抖动、会话跳回与停止失效 (#264)
* fix(web): stabilize active task ordering * fix(chat): preserve navigation during conversation startup * fix(tasks): guarantee hard cancellation * fix(chat): bind navigation and hard stop targets * fix(chat): prevent replay from reclaiming navigation
This commit is contained in:
@@ -18,6 +18,12 @@ function buildHashForPage(pageId) {
|
||||
|
||||
let chatConversationFromHashSeq = 0;
|
||||
|
||||
function cancelScheduledChatConversationFromHash() {
|
||||
chatConversationFromHashSeq++;
|
||||
setChatConversationRestorePending('', false);
|
||||
}
|
||||
window.cancelScheduledChatConversationFromHash = cancelScheduledChatConversationFromHash;
|
||||
|
||||
function setChatConversationRestorePending(conversationId, pending) {
|
||||
const container = document.querySelector('.chat-container');
|
||||
if (!container) return;
|
||||
@@ -123,6 +129,9 @@ function switchPage(pageId) {
|
||||
if (!targetPage) return;
|
||||
if (pageId !== 'chat') {
|
||||
setChatConversationRestorePending('', false);
|
||||
if (currentPage === 'chat' && typeof window.abandonChatConversationForPageNavigation === 'function') {
|
||||
window.abandonChatConversationForPageNavigation();
|
||||
}
|
||||
}
|
||||
|
||||
// 导航点击会修改 hash,随后浏览器还会触发 hashchange。
|
||||
|
||||
Reference in New Issue
Block a user