~sirn/fanboi2

966e78a3f3dfd99ef0f872fadb0584ceb1f403c1 — Kridsada Thanabulpong 4 years ago 4d929ac
Fix a bug where URL topic URL get rewritten.

When user make a reply on /board/1234 page, previous regex will
mistakenly recognize the number as post number rather than topic
and will try to append latest post number to it.
1 files changed, 1 insertions(+), 1 deletions(-)

M assets/app/javascripts/components/topic/topic_load_posts.ts
M assets/app/javascripts/components/topic/topic_load_posts.ts => assets/app/javascripts/components/topic/topic_load_posts.ts +1 -1
@@ 76,7 76,7 @@ export class TopicLoadPosts implements ITopicEventHandler {
            let path = window.location.pathname;
            let newPath: string = '';

            if (path.match(/\/\d+\/?$/)) {
            if (path.match(/\/\d+\/\d+\/?$/)) {
                newPath = path.replace(
                    /\/(\d+)\/?$/,
                    `/$1-${this.lastPostNumber}/`