mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 07:36:37 +00:00
Fixing empty post url. Fixes #70
This commit is contained in:
parent
1afeb7900e
commit
2a82bead57
|
@ -366,7 +366,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue