From 318b8c691a75f274d845dbf65f2edaf036479239 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 22 Jun 2020 19:27:42 -0400 Subject: [PATCH] Coerce empty post form to undefined. Fixes #602 --- ui/src/components/post-form.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index ee805a7c..c507ab3e 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -408,6 +408,12 @@ export class PostForm extends Component { handlePostSubmit(i: PostForm, event: any) { event.preventDefault(); + + // Coerce empty url string to undefined + if (i.state.postForm.url && i.state.postForm.url === '') { + i.state.postForm.url = undefined; + } + if (i.props.post) { WebSocketService.Instance.editPost(i.state.postForm); } else { -- 2.44.1