mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
refac
This commit is contained in:
parent
8f3144adb5
commit
10f06a64fe
2 changed files with 11 additions and 14 deletions
|
|
@ -904,6 +904,9 @@
|
|||
}
|
||||
];
|
||||
} else {
|
||||
if (files.find((f) => f.url === data || f.name === data)) {
|
||||
return;
|
||||
}
|
||||
onUpload(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -939,6 +942,9 @@
|
|||
}
|
||||
];
|
||||
} else {
|
||||
if (files.find((f) => f.url === data || f.name === data)) {
|
||||
return;
|
||||
}
|
||||
onUpload(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -974,6 +980,9 @@
|
|||
}
|
||||
];
|
||||
} else {
|
||||
if (files.find((f) => f.url === data || f.name === data)) {
|
||||
return;
|
||||
}
|
||||
onUpload(e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,19 +138,7 @@
|
|||
await tick();
|
||||
});
|
||||
|
||||
const onKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
select();
|
||||
}
|
||||
};
|
||||
onMount(() => {
|
||||
window.addEventListener('keydown', onKeyDown);
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
window.removeEventListener('keydown', onKeyDown);
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if filteredItems.length > 0 || query.startsWith('http')}
|
||||
|
|
@ -220,7 +208,7 @@
|
|||
<button
|
||||
class="px-2 py-1 rounded-xl w-full text-left bg-gray-50 dark:bg-gray-800 dark:text-gray-100 selected-command-option-button"
|
||||
type="button"
|
||||
data-selected={true}
|
||||
data-selected={selectedIdx === filteredItems.findIndex((i) => i.type === 'youtube')}
|
||||
on:click={() => {
|
||||
if (isValidHttpUrl(query)) {
|
||||
onSelect({
|
||||
|
|
@ -248,7 +236,7 @@
|
|||
<button
|
||||
class="px-2 py-1 rounded-xl w-full text-left bg-gray-50 dark:bg-gray-800 dark:text-gray-100 selected-command-option-button"
|
||||
type="button"
|
||||
data-selected={true}
|
||||
data-selected={selectedIdx === filteredItems.findIndex((i) => i.type === 'web')}
|
||||
on:click={() => {
|
||||
if (isValidHttpUrl(query)) {
|
||||
onSelect({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue