diff --git a/js/src/common/utils/patchMithril.ts b/js/src/common/utils/patchMithril.ts index 491939cf1..c174421be 100644 --- a/js/src/common/utils/patchMithril.ts +++ b/js/src/common/utils/patchMithril.ts @@ -2,7 +2,7 @@ import prop from 'mithril/stream'; export default () => { m.withAttr = (key: string, cb: Function) => function () { - cb(this.getAttribute(key)); + cb(this.getAttribute(key) || this[key]); }; m.prop = prop; diff --git a/js/src/forum/Forum.ts b/js/src/forum/Forum.ts index babbeb979..e0939e748 100644 --- a/js/src/forum/Forum.ts +++ b/js/src/forum/Forum.ts @@ -16,6 +16,8 @@ export default class Forum extends Application { 'user.posts': { path: '/u/:username', component: PostsUserPage }, 'user.discussions': { path: '/u/:username', component: PostsUserPage }, 'settings': { path: '/u/:username', component: PostsUserPage }, + + 'discussion': { path: '/d/:id', IndexPage }, }; /** diff --git a/js/src/forum/components/DiscussionsSearchSource.tsx b/js/src/forum/components/DiscussionsSearchSource.tsx index 6c9368307..3ca478006 100644 --- a/js/src/forum/components/DiscussionsSearchSource.tsx +++ b/js/src/forum/components/DiscussionsSearchSource.tsx @@ -43,10 +43,10 @@ export default class DiscussionsSearchSource extends SearchSource { return (