From: Dessalines Date: Tue, 3 Nov 2020 15:53:18 +0000 (-0600) Subject: Fixing empty post url. Fixes #70 X-Git-Url: http://these/git/readmes/%24%7B%60data:application/static/%7B?a=commitdiff_plain;h=2a82bead57ec54fe732b6a02baf45f81328edcdd;p=lemmy-ui.git Fixing empty post url. Fixes #70 --- diff --git a/src/shared/components/post-form.tsx b/src/shared/components/post-form.tsx index c383c9b..3c7df35 100644 --- a/src/shared/components/post-form.tsx +++ b/src/shared/components/post-form.tsx @@ -366,7 +366,7 @@ export class PostForm extends Component { event.preventDefault(); // Coerce empty url string to undefined - if (i.state.postForm.url && i.state.postForm.url === '') { + if (i.state.postForm.url !== undefined && i.state.postForm.url === '') { i.state.postForm.url = undefined; } diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 228aa9a..11a04b9 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -270,13 +270,8 @@ export function isVideo(url: string) { return videoRegex.test(url); } -// TODO this broke export function validURL(str: string) { - // try { return !!new URL(str); - // } catch { - // return false; - // } } export function communityRSSUrl(actorId: string, sort: string): string {