From: Dessalines Date: Mon, 22 Jun 2020 23:27:42 +0000 (-0400) Subject: Coerce empty post form to undefined. Fixes #602 X-Git-Url: http://these/git/readmes/%7B%60%24%7BarchiveTodayUrl%7D/%24%7BgetStaticDir%28%29%7D/js/static/gitweb.css?a=commitdiff_plain;h=318b8c691a75f274d845dbf65f2edaf036479239;p=lemmy.git Coerce empty post form to undefined. Fixes #602 --- 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 {