Skip to content

Commit

Permalink
Fix minimum title length not showing helpful error (#1496)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed May 21, 2024
1 parent b12620e commit fa832c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/post/new/PostEditorRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ export default function PostEditorRoot({

if (!title) {
errorMessage = "Please add a title to your post.";
} else if (title.length < 3) {
errorMessage = "Post title must contain at least three characters.";
} else if (postType === "link" && (!url || !validUrl(url))) {
errorMessage =
"Please add a valid URL to your post (start with https://).";
Expand All @@ -232,8 +234,8 @@ export default function PostEditorRoot({

if (errorMessage) {
presentToast({
// TODO more helpful msg
message: errorMessage,
color: "warning",
fullscreen: true,
});

Expand Down

0 comments on commit fa832c7

Please sign in to comment.