mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-09-09 16:08:49 -06:00
Coerce empty post form to undefined. Fixes #602
This commit is contained in:
parent
be3a375cae
commit
318b8c691a
6
ui/src/components/post-form.tsx
vendored
6
ui/src/components/post-form.tsx
vendored
@ -408,6 +408,12 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||||||
|
|
||||||
handlePostSubmit(i: PostForm, event: any) {
|
handlePostSubmit(i: PostForm, event: any) {
|
||||||
event.preventDefault();
|
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) {
|
if (i.props.post) {
|
||||||
WebSocketService.Instance.editPost(i.state.postForm);
|
WebSocketService.Instance.editPost(i.state.postForm);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user