mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: keep an open chat's tools when clicking a folder name (#30376)
Clicking a folder name in the sidebar while a chat was open switched that chat to the folder's default model for a moment before the page changed. That reset its tools and skills to the folder model's set and saved them as the chat's draft, so on returning to the chat the folder model's tools were shown and sent with the next message. The same happened to a chat just started from the home page. The folder's default model is now only applied while the chat has no messages yet, the same rule new chats already follow when a folder page opens. Folder pages, new chats in a folder and editing a folder's default model behave as before. Verified in a browser against a mock upstream: on dev the next request after the folder click carried the folder model's tool_ids and skill_ids; with the fix it carries the chat's own model's set, for both an existing chat and one started from the home page. Fixes #30226
This commit is contained in:
parent
d603b57995
commit
15f350b417
1 changed files with 6 additions and 1 deletions
|
|
@ -1593,7 +1593,12 @@
|
|||
|
||||
const selectedFolderSubscribe = selectedFolder.subscribe(async (folder) => {
|
||||
await tick();
|
||||
if (folder?.data?.model_ids && !equal(selectedModels, folder.data.model_ids)) {
|
||||
// Folder default models apply to new chats only.
|
||||
if (
|
||||
!history.currentId &&
|
||||
folder?.data?.model_ids &&
|
||||
!equal(selectedModels, folder.data.model_ids)
|
||||
) {
|
||||
selectedModels = folder.data.model_ids;
|
||||
|
||||
console.log('Set selectedModels from folder data:', selectedModels);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue