"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "f448a4b385af9020b9c070fecd9eae6cd440f631"
Commit 2f1f2b12 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: invalid url error handling

parent 28226a6f
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import { documents } from '$lib/stores'; import { documents } from '$lib/stores';
import { removeFirstHashWord, isValidHttpUrl } from '$lib/utils'; import { removeFirstHashWord, isValidHttpUrl } from '$lib/utils';
import { tick } from 'svelte'; import { tick } from 'svelte';
import toast from 'svelte-french-toast';
export let prompt = ''; export let prompt = '';
...@@ -92,6 +93,10 @@ ...@@ -92,6 +93,10 @@
const url = prompt.split(' ')?.at(0)?.substring(1); const url = prompt.split(' ')?.at(0)?.substring(1);
if (isValidHttpUrl(url)) { if (isValidHttpUrl(url)) {
confirmSelectWeb(url); confirmSelectWeb(url);
} else {
toast.error(
'Oops! Looks like the URL is invalid. Please double-check and try again.'
);
} }
}} }}
> >
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment