refac
This commit is contained in:
1 parent
316f1d6ff0
commit
05732de898
3 files changed
+14
-8
No files matched your search
@@ -7,7 +7,7 @@
|
||||
|
||||
import Modal from '$lib/components/common/Modal.svelte';
|
||||
import XMark from '$lib/components/icons/XMark.svelte';
|
||||
import { isValidHttpUrl } from '$lib/utils';
|
||||
import { isValidHttpUrl, isYoutubeUrl } from '$lib/utils';
|
||||
|
||||
export let show = false;
|
||||
export let onSubmit: (e) => void;
|
||||
@@ -17,10 +17,7 @@
|
||||
const submitHandler = () => {
|
||||
if (isValidHttpUrl(url)) {
|
||||
onSubmit({
|
||||
type:
|
||||
url.startsWith('https://www.youtube.com') || url.startsWith('https://youtu.be') || url.startsWith('https://youtube.com') || url.startsWith('https://m.youtube.com')
|
||||
? 'youtube'
|
||||
: 'web',
|
||||
type: isYoutubeUrl(url) ? 'youtube' : 'web',
|
||||
data: url
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user