refac
This commit is contained in:
@@ -904,6 +904,9 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
if (files.find((f) => f.url === data || f.name === data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onUpload(e);
|
onUpload(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -939,6 +942,9 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
if (files.find((f) => f.url === data || f.name === data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onUpload(e);
|
onUpload(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -974,6 +980,9 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
if (files.find((f) => f.url === data || f.name === data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onUpload(e);
|
onUpload(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,19 +138,7 @@
|
|||||||
await tick();
|
await tick();
|
||||||
});
|
});
|
||||||
|
|
||||||
const onKeyDown = (e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault();
|
|
||||||
select();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
onMount(() => {
|
|
||||||
window.addEventListener('keydown', onKeyDown);
|
|
||||||
});
|
|
||||||
|
|
||||||
onDestroy(() => {
|
|
||||||
window.removeEventListener('keydown', onKeyDown);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if filteredItems.length > 0 || query.startsWith('http')}
|
{#if filteredItems.length > 0 || query.startsWith('http')}
|
||||||
@@ -220,7 +208,7 @@
|
|||||||
<button
|
<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"
|
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"
|
type="button"
|
||||||
data-selected={true}
|
data-selected={selectedIdx === filteredItems.findIndex((i) => i.type === 'youtube')}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (isValidHttpUrl(query)) {
|
if (isValidHttpUrl(query)) {
|
||||||
onSelect({
|
onSelect({
|
||||||
@@ -248,7 +236,7 @@
|
|||||||
<button
|
<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"
|
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"
|
type="button"
|
||||||
data-selected={true}
|
data-selected={selectedIdx === filteredItems.findIndex((i) => i.type === 'web')}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
if (isValidHttpUrl(query)) {
|
if (isValidHttpUrl(query)) {
|
||||||
onSelect({
|
onSelect({
|
||||||
|
|||||||
Reference in New Issue
Block a user