Changeset 0.22.6 (#148)
This commit is contained in:
@@ -262,10 +262,8 @@ async function selectChat(chatId) {
|
||||
// Notify surfaces and extensions about channel switch (v0.21.6)
|
||||
Events.emit('chat.switched', { chatId, projectId: chat.projectId || null }, { localOnly: true });
|
||||
|
||||
// Sync URL hash (v0.21.6)
|
||||
if (typeof Router !== 'undefined' && Router._initialized) {
|
||||
Router.update('chat', { chatId });
|
||||
}
|
||||
// Update browser URL to reflect selected chat
|
||||
window.history.replaceState(null, '', `${window.__BASE__ || ''}/chat/${chatId}`);
|
||||
}
|
||||
|
||||
// ── Chat Header Token Count ──────────────────
|
||||
@@ -397,10 +395,7 @@ async function newChat() {
|
||||
if (typeof KnowledgeUI !== 'undefined') KnowledgeUI.onChatChanged();
|
||||
// Notify surfaces — no channel selected (v0.21.6)
|
||||
Events.emit('chat.switched', { chatId: null, projectId: null }, { localOnly: true });
|
||||
// Sync URL hash
|
||||
if (typeof Router !== 'undefined' && Router._initialized) {
|
||||
Router.update('chat');
|
||||
}
|
||||
window.history.replaceState(null, '', `${window.__BASE__ || ''}/`);
|
||||
}
|
||||
|
||||
async function deleteChat(chatId) {
|
||||
@@ -539,10 +534,7 @@ async function sendMessage() {
|
||||
UI.renderChatList();
|
||||
// Notify surfaces about new chat creation (v0.21.6)
|
||||
Events.emit('chat.created', { chatId: chat.id, projectId: chat.projectId || null }, { localOnly: true });
|
||||
// Sync URL hash
|
||||
if (typeof Router !== 'undefined' && Router._initialized) {
|
||||
Router.update('chat', { chatId: chat.id });
|
||||
}
|
||||
window.history.replaceState(null, '', `${window.__BASE__ || ''}/chat/${chat.id}`);
|
||||
} catch (e) { UI.toast('Failed to create chat: ' + e.message, 'error'); return; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user