Fixing empty post url. Fixes #70

This commit is contained in:
Dessalines 2020-11-03 09:53:18 -06:00
parent 1afeb7900e
commit 2a82bead57
2 changed files with 1 additions and 6 deletions

View file

@ -366,7 +366,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
event.preventDefault(); event.preventDefault();
// Coerce empty url string to undefined // 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; i.state.postForm.url = undefined;
} }

View file

@ -270,13 +270,8 @@ export function isVideo(url: string) {
return videoRegex.test(url); return videoRegex.test(url);
} }
// TODO this broke
export function validURL(str: string) { export function validURL(str: string) {
// try {
return !!new URL(str); return !!new URL(str);
// } catch {
// return false;
// }
} }
export function communityRSSUrl(actorId: string, sort: string): string { export function communityRSSUrl(actorId: string, sort: string): string {