diff options
author | Dessalines <tyhou13@gmx.com> | 2020-06-22 19:27:42 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-06-22 19:27:42 -0400 |
commit | 318b8c691a75f274d845dbf65f2edaf036479239 (patch) | |
tree | a356290c39399d1f98ac5b00bf95c3c8b8753d5b /ui/src/components/post-form.tsx | |
parent | be3a375caef2529d57598a2e3f2daa49eb27b441 (diff) |
Coerce empty post form to undefined. Fixes #602
Diffstat (limited to 'ui/src/components/post-form.tsx')
-rw-r--r-- | ui/src/components/post-form.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
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<PostFormProps, PostFormState> { 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 { |