Skip to content

Commit ef01c0b

Browse files
authored
Merge pull request GetStream#23 from GetStream/fix/profile-undefined-lastname
Add short circuit for last name interpolation
2 parents 32f85f4 + 8b86eb9 commit ef01c0b

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

app/docs/file/modules/routes/Home/routes/Photo/components/PhotoMetadata.js.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
<link type="text/css" rel="stylesheet" href="css/style.css">
88
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
99
<script src="script/prettify/prettify.js"></script>
10-
11-
10+
11+
1212
<script src="script/manual.js"></script>
1313
</head>
1414
<body class="layout-container" data-ice="rootContainer">
1515

1616
<header>
1717
<a href="./">Home</a>
18-
18+
1919
<a href="identifiers.html">Reference</a>
2020
<a href="source.html">Source</a>
21-
22-
21+
22+
2323
<div class="search-box">
2424
<span>
2525
<img src="./image/search.png">
@@ -31,7 +31,7 @@
3131

3232
<nav class="navigation" data-ice="nav"><div>
3333
<ul>
34-
34+
3535
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">actions</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-load">load</a></span></span></li>
3636
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-init">init</a></span></span></li>
3737
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initDone">initDone</a></span></span></li>
@@ -167,7 +167,7 @@
167167
&lt;Link to={`/profile/${this.props.user_id}`}&gt;
168168
&lt;div className=&quot;artist&quot;&gt;
169169
&lt;Avatar email={this.props.email} height={50}/&gt;
170-
{`${this.props.first_name} ${this.props.last_name.charAt(0) + &apos;.&apos;}`}
170+
{this.props.first_name} {this.props.last_name &amp;&amp; this.props.last_name.charAt(0) + &apos;.&apos;}
171171
&lt;/div&gt;
172172
&lt;/Link&gt;
173173
&lt;div className=&quot;like-count&quot;&gt;

app/docs/file/modules/routes/Profile/Profile.js.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
<link type="text/css" rel="stylesheet" href="css/style.css">
88
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
99
<script src="script/prettify/prettify.js"></script>
10-
11-
10+
11+
1212
<script src="script/manual.js"></script>
1313
</head>
1414
<body class="layout-container" data-ice="rootContainer">
1515

1616
<header>
1717
<a href="./">Home</a>
18-
18+
1919
<a href="identifiers.html">Reference</a>
2020
<a href="source.html">Source</a>
21-
22-
21+
22+
2323
<div class="search-box">
2424
<span>
2525
<img src="./image/search.png">
@@ -31,7 +31,7 @@
3131

3232
<nav class="navigation" data-ice="nav"><div>
3333
<ul>
34-
34+
3535
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">actions</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-load">load</a></span></span></li>
3636
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-init">init</a></span></span></li>
3737
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-initDone">initDone</a></span></span></li>
@@ -259,7 +259,7 @@
259259
&lt;Avatar email={this.props.profile.email}/&gt;
260260
&lt;/div&gt;
261261
&lt;div className=&quot;name&quot;&gt;
262-
{this.props.profile.first_name} &lt;br /&gt; {this.props.profile.last_name.charAt(0) + &apos;.&apos;}
262+
{this.props.profile.first_name} &lt;br /&gt; {this.props.profile.last_name &amp;&amp; this.props.profile.last_name.charAt(0) + &apos;.&apos;}
263263
&lt;/div&gt;
264264
&lt;div className=&quot;follow-count&quot;&gt;
265265
&lt;div className=&quot;following&quot;&gt;

app/modules/components/Activity/Actor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class Actor extends Component {
2828
<div className="avatar">
2929
<Avatar emailHash={this.props.email_md5} height={50}/>
3030
</div>
31-
<div className="name">{this.props.first_name} <br/>{this.props.last_name.charAt(0) + '.'}</div>
31+
<div className="name">{this.props.first_name} <br/>{this.props.last_name && this.props.last_name.charAt(0) + '.'}</div>
3232
</div>
3333
</Link>
3434
)

app/modules/components/PhotoList/PhotoItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Actor extends Component {
1919
height={32} />
2020
</Link>
2121
<span><strong>
22-
<Link to={`/profile/${this.props.id}`}>{this.props.first_name} {this.props.last_name.charAt(0) + '.'}</Link>
22+
<Link to={`/profile/${this.props.id}`}>{this.props.first_name} {this.props.last_name && this.props.last_name.charAt(0) + '.'}</Link>
2323
</strong></span>
2424
</div>
2525
)

app/modules/reducers/Search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function Search(state = initialState, action) {
6262
word = {
6363
email: a.email,
6464
id: a.id,
65-
name: `${a.first_name} ${a.last_name.charAt(0)}.`
65+
name: `${a.first_name} ${a.last_name && a.last_name.charAt(0)}.`
6666
}
6767
type = 'user'
6868
}

app/modules/routes/Home/routes/Photo/components/PhotoMetadata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class PhotoMetadata extends Component {
2222
<Link to={`/profile/${this.props.user_id}`}>
2323
<div className="artist">
2424
<Avatar emailHash={this.props.email_md5} height={50}/>
25-
{`${this.props.first_name} ${this.props.last_name.charAt(0) + '.'}`}
25+
{this.props.first_name} {this.props.last_name && this.props.last_name.charAt(0) + '.'}
2626
</div>
2727
</Link>
2828
<div className="like-count">

app/modules/routes/Profile/Profile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Profile extends Component {
138138
<Avatar emailHash={this.props.profile.email_md5}/>
139139
</div>
140140
<div className="name">
141-
{this.props.profile.first_name} <br /> {this.props.profile.last_name.charAt(0) + '.'}
141+
{this.props.profile.first_name} <br />{this.props.profile.last_name && this.props.profile.last_name.charAt(0) + '.'}
142142
</div>
143143
<div className="follow-count">
144144
<div className="following">

0 commit comments

Comments
 (0)