From 2a82bead57ec54fe732b6a02baf45f81328edcdd Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 3 Nov 2020 09:53:18 -0600 Subject: [PATCH] Fixing empty post url. Fixes #70 --- src/shared/components/post-form.tsx | 2 +- src/shared/utils.ts | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) 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 { -- 2.44.1