1
0
mirror of https://github.com/flarum/core.git synced 2025-06-03 21:26:03 +02:00

fix: classes function including empty strings

This commit is contained in:
David Wheatley 2021-12-20 16:35:54 +01:00
parent 4ad961c972
commit c34b8cd1c2
No known key found for this signature in database
GPG Key ID: DCC0FCE349280DFF

View File

@ -124,7 +124,10 @@ export default class Post extends Component {
* @returns {string[]}
*/
classes(existing) {
let classes = (existing || '').split(' ').concat(['Post']);
const classes = (existing || '')
.split(' ')
.filter((x) => x.trim() !== '')
.concat(['Post']);
const user = this.attrs.post.user();
const discussion = this.attrs.post.discussion();