mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
refac
This commit is contained in:
@@ -2085,6 +2085,7 @@
|
|||||||
|
|
||||||
const MAX_DRAFT_LENGTH = 5000;
|
const MAX_DRAFT_LENGTH = 5000;
|
||||||
let saveDraftTimeout = null;
|
let saveDraftTimeout = null;
|
||||||
|
|
||||||
const saveDraft = async (draft, chatId = null) => {
|
const saveDraft = async (draft, chatId = null) => {
|
||||||
if (saveDraftTimeout) {
|
if (saveDraftTimeout) {
|
||||||
clearTimeout(saveDraftTimeout);
|
clearTimeout(saveDraftTimeout);
|
||||||
@@ -2101,6 +2102,13 @@
|
|||||||
sessionStorage.removeItem(`chat-input${chatId ? `-${chatId}` : ''}`);
|
sessionStorage.removeItem(`chat-input${chatId ? `-${chatId}` : ''}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clearDraft = async (chatId = null) => {
|
||||||
|
if (saveDraftTimeout) {
|
||||||
|
clearTimeout(saveDraftTimeout);
|
||||||
|
}
|
||||||
|
await sessionStorage.removeItem(`chat-input${chatId ? `-${chatId}` : ''}`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@@ -2252,6 +2260,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:submit={async (e) => {
|
on:submit={async (e) => {
|
||||||
|
clearDraft();
|
||||||
if (e.detail || files.length > 0) {
|
if (e.detail || files.length > 0) {
|
||||||
await tick();
|
await tick();
|
||||||
submitPrompt(
|
submitPrompt(
|
||||||
@@ -2304,6 +2313,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:submit={async (e) => {
|
on:submit={async (e) => {
|
||||||
|
clearDraft();
|
||||||
if (e.detail || files.length > 0) {
|
if (e.detail || files.length > 0) {
|
||||||
await tick();
|
await tick();
|
||||||
submitPrompt(
|
submitPrompt(
|
||||||
|
|||||||
1
static/pyodide/pyodide-lock.json
Normal file
1
static/pyodide/pyodide-lock.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user