mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 03:12:01 +08:00
parent
af2307868a
commit
283abb88c2
|
@ -61,9 +61,9 @@ export default class DiscussionPage extends Page {
|
|||
if (idParam && idParam.split('-')[0] === this.discussion.id()) {
|
||||
e.preventDefault();
|
||||
|
||||
const near = Number(m.route.param('near')) || 1;
|
||||
const near = m.route.param('near') || '1';
|
||||
|
||||
if (near !== Number(this.near)) {
|
||||
if (near !== String(this.near)) {
|
||||
this.stream.goToNumber(near);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ export default function(app) {
|
|||
* @return {String}
|
||||
*/
|
||||
app.route.discussion = (discussion, near) => {
|
||||
return app.route(near > 1 ? 'discussion.near' : 'discussion', {
|
||||
return app.route(near && near !== 1 ? 'discussion.near' : 'discussion', {
|
||||
id: discussion.id() + '-' + discussion.slug(),
|
||||
near: near > 1 ? near : undefined
|
||||
near: near && near !== 1 ? near : undefined
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user