mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-06 02:48:04 +00:00
refac
This commit is contained in:
parent
efe63bd34a
commit
332237662f
2 changed files with 6 additions and 7 deletions
|
|
@ -429,6 +429,7 @@
|
|||
let loadedChatIdProp = '';
|
||||
let currentDraftKey = '';
|
||||
|
||||
// Chat parameters own the approval mode; chats without an override use the user default.
|
||||
$: toolApprovalMode =
|
||||
(params?.tool_approval_mode ?? $settings?.params?.tool_approval_mode) === 'ask'
|
||||
? 'ask'
|
||||
|
|
@ -769,9 +770,8 @@
|
|||
webSearchEnabled = input.webSearchEnabled ?? false;
|
||||
imageGenerationEnabled = input.imageGenerationEnabled ?? false;
|
||||
codeInterpreterEnabled = input.codeInterpreterEnabled ?? false;
|
||||
if (input.toolApprovalMode) {
|
||||
await handleToolApprovalModeChange(input.toolApprovalMode);
|
||||
}
|
||||
// Ignore approval modes in older drafts. Restoring input must not overwrite chat
|
||||
// parameters or invoke the change handler, which can save settings and approve tools.
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
|
|
@ -4101,8 +4101,7 @@
|
|||
selectedFilterIds,
|
||||
imageGenerationEnabled,
|
||||
webSearchEnabled,
|
||||
codeInterpreterEnabled,
|
||||
toolApprovalMode
|
||||
codeInterpreterEnabled
|
||||
});
|
||||
|
||||
const saveDraft = async (draft: any, chatId: string | null = null, debounce = true) => {
|
||||
|
|
|
|||
|
|
@ -238,6 +238,7 @@
|
|||
}
|
||||
|
||||
let chatInputDraft: any;
|
||||
// Approval mode is persisted in chat parameters and user settings, not input drafts.
|
||||
$: chatInputDraft = {
|
||||
prompt,
|
||||
files: files
|
||||
|
|
@ -254,8 +255,7 @@
|
|||
selectedFilterIds,
|
||||
imageGenerationEnabled,
|
||||
webSearchEnabled,
|
||||
codeInterpreterEnabled,
|
||||
toolApprovalMode
|
||||
codeInterpreterEnabled
|
||||
};
|
||||
|
||||
$: onChange(chatInputDraft);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue