show display_name in profile title

This commit is contained in:
Martti Malmi 2023-02-10 16:11:05 +02:00
parent ec2b3546f8
commit eca71e1559
4 changed files with 9 additions and 3 deletions

View File

@ -156,7 +156,8 @@ export default {
}
if (settings.enableInstagram !== false) {
const igRegex = /(?:https?:\/\/)?(?:www\.)?(?:instagram\.com\/)((?:p|reel)\/[\w-]{11})(?:\S+)?/g;
const igRegex =
/(?:https?:\/\/)?(?:www\.)?(?:instagram\.com\/)((?:p|reel)\/[\w-]{11})(?:\S+)?/g;
replacedText = reactStringReplace(replacedText, igRegex, (match, i) => {
return (
<iframe

View File

@ -98,6 +98,7 @@ class PublicMessage extends Message {
if (this.props.standalone) {
if (!prevState.msg && this.state.msg) {
setTimeout(() => {
// important for SEO: prerenderReady is false until page content is loaded
window.prerenderReady = true;
}, 1000); // give other things a sec to load
}

View File

@ -23,7 +23,7 @@ class Message extends View {
this.restoreScrollPosition();
}
componentDidUpdate(prevProps, prevState) {
componentDidUpdate(prevProps) {
if (prevProps.hash !== this.props.hash) {
this.restoreScrollPosition();
}

View File

@ -304,7 +304,9 @@ class Profile extends View {
}
const title = this.state.name || 'Profile';
const ogTitle = `${title} | Iris`;
const description = `Latest posts by ${this.state.name || 'user'}. ${this.state.about || ''}`;
const description = `Latest posts by ${this.state.display_name || this.state.name || 'user'}. ${
this.state.about || ''
}`;
return html`
${this.state.banner
? html`
@ -397,6 +399,7 @@ class Profile extends View {
// profile may contain arbitrary fields, so be careful
this.setState({
name: profile.name,
display_name: profile.display_name,
about: Helpers.highlightLinks(profile.about),
picture: profile.picture,
nip05: profile.nip05valid && profile.nip05,
@ -437,6 +440,7 @@ class Profile extends View {
componentDidUpdate(prevProps, prevState) {
if (!prevState.name && this.state.name) {
setTimeout(() => {
// important for SEO: prerenderReady is false until page content is loaded
window.prerenderReady = true;
}, 1000); // give feed a sec to load
}