Skip to content

Commit

Permalink
Move fetchPageTitle into componentWillMount and only call client side. (
Browse files Browse the repository at this point in the history
  • Loading branch information
matc-pub authored Jun 7, 2024
1 parent 66c60d9 commit 300ed5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/shared/components/post/post-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { LanguageSelect } from "../common/language-select";
import { MarkdownTextArea } from "../common/markdown-textarea";
import { SearchableSelect } from "../common/searchable-select";
import { PostListings } from "./post-listings";
import { isBrowser } from "@utils/browser";

const MAX_POST_TITLE_LENGTH = 200;

Expand Down Expand Up @@ -367,8 +368,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
},
};
}
}

if (this.state.form.url) {
componentWillMount() {
if (this.state.form.url && isBrowser()) {
this.fetchPageTitle();
}
}
Expand Down

0 comments on commit 300ed5f

Please sign in to comment.