fix(ui): 未开始会话时不切到文件树,空树直接退回会话列表

This commit is contained in:
2026-11-11 15:48:23 +08:00
parent 419e3fc914
commit 20824dc42e
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -134,7 +134,13 @@
async function renderBody() {
const body = $('tree-body');
if (!body) return;
if (!sid()) { body.innerHTML = ''; tip(body, '尚未开始会话'); return; }
// 没有会话就没有任务目录:不写提示,直接把侧栏退回会话列表。
// 这条会兜住「在文件页里点了新建会话 / 删掉了当前会话」——那时卡片不该停在一个空树里。
if (!sid()) {
body.innerHTML = '';
if (typeof setDrawerPane === 'function') setDrawerPane(false);
return;
}
const sc = body.scrollTop;
body.innerHTML = '';
const root = document.createElement('div');