Move fetchPageTitle into componentWillMount and only call client side. (#2519)

This commit is contained in:
matc-pub 2024-06-07 20:54:53 +02:00 committed by GitHub
parent 66c60d9f14
commit 300ed5fe03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
@ -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();
}
}