mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 05:55:58 +08:00
Simplify active discussion detection
This commit is contained in:
parent
6b7632cda3
commit
b36e3f1053
|
@ -127,8 +127,7 @@ export default class DiscussionList extends Component {
|
|||
|
||||
var controls = discussion.controls(this).toArray();
|
||||
|
||||
var discussionRoute = app.route('discussion', { id: discussion.id(), slug: discussion.slug() });
|
||||
var active = m.route().substr(0, discussionRoute.length) === discussionRoute;
|
||||
var active = m.route.param('id') === discussion.id();
|
||||
|
||||
var subtree = this.subtrees[discussion.id()];
|
||||
return m('li.discussion-summary'+(isUnread ? '.unread' : '')+(active ? '.active' : ''), {
|
||||
|
|
Loading…
Reference in New Issue
Block a user