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) { 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) => { replacedText = reactStringReplace(replacedText, igRegex, (match, i) => {
return ( return (
<iframe <iframe

View File

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

View File

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

View File

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