mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
refac
This commit is contained in:
parent
7cd0f14110
commit
500ff30bb7
1 changed files with 4 additions and 1 deletions
|
|
@ -59,6 +59,8 @@
|
|||
|
||||
// Directory and preview state belong to this tab, including its terminal connection.
|
||||
let savedPath = '/';
|
||||
// savedPath is only a placeholder until a directory has loaded.
|
||||
let savedPathLoaded = false;
|
||||
let savedFileRoot: TerminalFileRoot | null = null;
|
||||
const treeExpandedCache = new Map<string, string[]>();
|
||||
const treeContentsCache = new Map<string, [string, FileEntry[]][]>();
|
||||
|
|
@ -706,7 +708,7 @@
|
|||
}
|
||||
// Chat just got created (null → real ID): persist the current
|
||||
// browsed path as the new session's cwd — don't re-fetch.
|
||||
setCwd(terminal.url, terminal.key, savedPath, chatId);
|
||||
if (savedPathLoaded) setCwd(terminal.url, terminal.key, savedPath, chatId);
|
||||
} else if (terminalChanged || chatChanged) {
|
||||
++loadGeneration;
|
||||
openedFile = null;
|
||||
|
|
@ -1032,6 +1034,7 @@
|
|||
}
|
||||
currentPath = directory;
|
||||
savedPath = directory;
|
||||
savedPathLoaded = true;
|
||||
pushNavHistory(directory);
|
||||
|
||||
const result = await listFiles(terminal.url, terminal.key, directory, chatId ?? undefined);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue