mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 00:01:01 +08:00
Merge pull request #1456 from sijad/prevent-undefined
check class string before concat
This commit is contained in:
commit
afe06ea750
|
@ -80,7 +80,7 @@ export default class CommentPost extends Post {
|
|||
const post = this.props.post;
|
||||
const attrs = super.attrs();
|
||||
|
||||
attrs.className += ' '+classList({
|
||||
attrs.className = (attrs.className || '') + ' ' + classList({
|
||||
'CommentPost': true,
|
||||
'Post--hidden': post.isHidden(),
|
||||
'Post--edited': post.isEdited(),
|
||||
|
|
|
@ -18,7 +18,7 @@ export default class EventPost extends Post {
|
|||
attrs() {
|
||||
const attrs = super.attrs();
|
||||
|
||||
attrs.className += ' EventPost ' + ucfirst(this.props.post.contentType()) + 'Post';
|
||||
attrs.className = (attrs.className || '') + ' EventPost ' + ucfirst(this.props.post.contentType()) + 'Post';
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user