From 283abb88c22b041ba924910aeb576767af2d6980 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 31 Aug 2015 13:27:04 +0930 Subject: [PATCH] Fix reply composer preview button closes #238 --- js/forum/src/components/DiscussionPage.js | 4 ++-- js/forum/src/initializers/routes.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/forum/src/components/DiscussionPage.js b/js/forum/src/components/DiscussionPage.js index bf8257b71..c51d7792f 100644 --- a/js/forum/src/components/DiscussionPage.js +++ b/js/forum/src/components/DiscussionPage.js @@ -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); } diff --git a/js/forum/src/initializers/routes.js b/js/forum/src/initializers/routes.js index cd16b3081..c319b3d1a 100644 --- a/js/forum/src/initializers/routes.js +++ b/js/forum/src/initializers/routes.js @@ -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 }); };