diff options
Diffstat (limited to 'ui/src/components/navbar.tsx')
-rw-r--r-- | ui/src/components/navbar.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 31dab61b..ee19e5c5 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -79,7 +79,7 @@ export class Navbar extends Component<any, NavbarState> { <Link class="nav-link" to="/search">Search</Link> </li> <li class="nav-item"> - <Link class="nav-link" to="/create_post">Create Post</Link> + <Link class="nav-link" to={{pathname: '/create_post', state: { prevPath: this.currentLocation }}}>Create Post</Link> </li> <li class="nav-item"> <Link class="nav-link" to="/create_community">Create Community</Link> @@ -165,6 +165,10 @@ export class Navbar extends Component<any, NavbarState> { } } + get currentLocation() { + return this.context.router.history.location.pathname; + } + sendRepliesCount(res: GetRepliesResponse) { UserService.Instance.sub.next({user: UserService.Instance.user, unreadCount: res.replies.filter(r => !r.read).length}); } |