mirror of
https://github.com/flarum/core.git
synced 2025-10-26 05:06:06 +01:00
Clean up app.current, app.previous in JS (#2156)
- Encapsulate app.current, app.previous in PageState objects - Reorganize Page classes to use one central base class in common Co-authored-by: Franz Liedke <franz@develophp.org>
This commit is contained in:
committed by
GitHub
parent
88366fe8af
commit
71e313e677
@@ -116,6 +116,7 @@ export default class Post extends Component {
|
||||
let classes = (existing || '').split(' ').concat(['Post']);
|
||||
|
||||
const user = this.props.post.user();
|
||||
const discussion = this.props.post.discussion();
|
||||
|
||||
if (this.loading) {
|
||||
classes.push('Post--loading');
|
||||
@@ -125,7 +126,7 @@ export default class Post extends Component {
|
||||
classes.push('Post--by-actor');
|
||||
}
|
||||
|
||||
if (user && app.current.discussion && app.current.discussion.attribute('startUserId') == user.id()) {
|
||||
if (user && user === discussion.user()) {
|
||||
classes.push('Post--by-start-user');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user