refac
This commit is contained in:
1 parent
f59d86a10c
commit
2f2bf38e34
1 file changed
+12
-10
@@ -845,7 +845,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ── Lifecycle ────────────────────────────────────────────────────────
|
// ── Lifecycle ────────────────────────────────────────────────────────
|
||||||
onMount(async () => {
|
onMount(() => {
|
||||||
const terminal = getTerminal();
|
const terminal = getTerminal();
|
||||||
|
|
||||||
let handledDisplayFile = false;
|
let handledDisplayFile = false;
|
||||||
@@ -904,16 +904,18 @@
|
|||||||
if (!handledDisplayFile && terminal) {
|
if (!handledDisplayFile && terminal) {
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
// Discover server features on initial mount
|
void (async () => {
|
||||||
const config = await getTerminalConfig(terminal.url, terminal.key);
|
// Discover server features on initial mount
|
||||||
terminalEnabled = config?.features?.terminal !== false;
|
const config = await getTerminalConfig(terminal.url, terminal.key);
|
||||||
|
terminalEnabled = config?.features?.terminal !== false;
|
||||||
|
|
||||||
if (chatId || savedPath === '/') {
|
if (chatId || savedPath === '/') {
|
||||||
// Fetch session-specific cwd from the server (or global default for new chats)
|
// Fetch session-specific cwd from the server (or global default for new chats)
|
||||||
savedPath = applyCwd(await getCwd(terminal.url, terminal.key, chatId ?? undefined));
|
savedPath = applyCwd(await getCwd(terminal.url, terminal.key, chatId ?? undefined));
|
||||||
}
|
}
|
||||||
savedPath = clampToFileRoot(savedPath);
|
savedPath = clampToFileRoot(savedPath);
|
||||||
loadDir(savedPath);
|
loadDir(savedPath);
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
mounted = true;
|
mounted = true;
|
||||||
|
|||||||
Reference in new issue
Block a user