mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
refac
This commit is contained in:
parent
20fe43d9da
commit
a21c8d15ee
1 changed files with 12 additions and 6 deletions
|
|
@ -3996,6 +3996,7 @@
|
|||
|
||||
const MAX_DRAFT_LENGTH = 5000;
|
||||
let saveDraftTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
const getDraftChatId = () => chatIdProp || null;
|
||||
|
||||
const getChatInputDraft = () => ({
|
||||
prompt,
|
||||
|
|
@ -4451,9 +4452,9 @@
|
|||
onQueueSendNow={sendQueuedMessageNow}
|
||||
onQueueEdit={editQueuedMessage}
|
||||
onQueueDelete={deleteQueuedMessage}
|
||||
onChange={(data) => {
|
||||
onChange={(data: any) => {
|
||||
if (!$temporaryChatEnabled) {
|
||||
saveDraft(data, $chatId);
|
||||
saveDraft(data, getDraftChatId());
|
||||
}
|
||||
}}
|
||||
onWebSearchToggle={handleWebSearchToggle}
|
||||
|
|
@ -4461,7 +4462,7 @@
|
|||
showChatVariablesModal = true;
|
||||
}}
|
||||
on:submit={async (e) => {
|
||||
clearDraft($chatId);
|
||||
clearDraft(getDraftChatId());
|
||||
if (e.detail || files.length > 0) {
|
||||
await tick();
|
||||
|
||||
|
|
@ -4543,12 +4544,17 @@
|
|||
onQueueSendNow={sendQueuedMessageNow}
|
||||
onQueueEdit={editQueuedMessage}
|
||||
onQueueDelete={deleteQueuedMessage}
|
||||
onChange={(data: any) => {
|
||||
if (!$temporaryChatEnabled) {
|
||||
saveDraft(data, getDraftChatId());
|
||||
}
|
||||
}}
|
||||
onWebSearchToggle={handleWebSearchToggle}
|
||||
on:chatVariables={() => {
|
||||
showChatVariablesModal = true;
|
||||
}}
|
||||
on:submit={async (e) => {
|
||||
clearDraft($chatId);
|
||||
clearDraft(getDraftChatId());
|
||||
if (e.detail || files.length > 0) {
|
||||
await tick();
|
||||
submitHandler(withSelectedText(e.detail));
|
||||
|
|
@ -4593,9 +4599,9 @@
|
|||
on:chatVariables={() => {
|
||||
showChatVariablesModal = true;
|
||||
}}
|
||||
onChange={(data) => {
|
||||
onChange={(data: any) => {
|
||||
if (!$temporaryChatEnabled) {
|
||||
saveDraft(data);
|
||||
saveDraft(data, getDraftChatId());
|
||||
}
|
||||
}}
|
||||
on:submit={async (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue