fix(ui): 未开始会话时不切到文件树,空树直接退回会话列表
This commit is contained in:
@@ -134,7 +134,13 @@
|
|||||||
async function renderBody() {
|
async function renderBody() {
|
||||||
const body = $('tree-body');
|
const body = $('tree-body');
|
||||||
if (!body) return;
|
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;
|
const sc = body.scrollTop;
|
||||||
body.innerHTML = '';
|
body.innerHTML = '';
|
||||||
const root = document.createElement('div');
|
const root = document.createElement('div');
|
||||||
|
|||||||
@@ -1239,6 +1239,8 @@
|
|||||||
function setDrawerPane(files) {
|
function setDrawerPane(files) {
|
||||||
// 窄屏没有文件树(只有输入行右侧的旧文件面板),任何调用方都不允许切过去
|
// 窄屏没有文件树(只有输入行右侧的旧文件面板),任何调用方都不允许切过去
|
||||||
if (files && !drawerMQ.matches) return;
|
if (files && !drawerMQ.matches) return;
|
||||||
|
// 还没开始会话 = 没有任务目录:不切过去(否则只能切出一个写着「尚未开始会话」的空面板)
|
||||||
|
if (files && !state.sessionId) return;
|
||||||
// 文件树模块没加载成功时不要把一个空面板切出来
|
// 文件树模块没加载成功时不要把一个空面板切出来
|
||||||
if (files && typeof window.showFileTree !== 'function') return;
|
if (files && typeof window.showFileTree !== 'function') return;
|
||||||
const drawer = $('drawer');
|
const drawer = $('drawer');
|
||||||
|
|||||||
Reference in New Issue
Block a user