mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-28 23:31:14 +00:00
Fix suggested title " " spaces (#2037)
* Fix imported title   spaces * Update src/shared/components/post/post-form.tsx Co-authored-by: SleeplessOne1917 <abias1122@gmail.com> * Fix lint issue --------- Co-authored-by: SleeplessOne1917 <abias1122@gmail.com>
This commit is contained in:
parent
d2fce684c0
commit
c303e00b27
1 changed files with 4 additions and 2 deletions
|
@ -581,8 +581,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
|
||||||
case "loading":
|
case "loading":
|
||||||
return <Spinner />;
|
return <Spinner />;
|
||||||
case "success": {
|
case "success": {
|
||||||
const suggestedTitle = this.state.metadataRes.data.metadata.title;
|
// Clean up the title of any extra whitespace and replace with a space
|
||||||
|
const suggestedTitle = this.state.metadataRes.data.metadata.title
|
||||||
|
?.trim()
|
||||||
|
.replace(/\s+/g, " ");
|
||||||
return (
|
return (
|
||||||
suggestedTitle && (
|
suggestedTitle && (
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue