diff options
author | Dessalines <tyhou13@gmx.com> | 2019-05-08 09:07:34 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-05-08 09:07:34 -0700 |
commit | 73a129a24d846b387357336bec7b5c8b09c5a6ba (patch) | |
tree | 993120477c3eee8269ecdd52f8f6ab121f4c24f8 /ui/src/components/create-post.tsx | |
parent | 780817840f718500063579056081cfc1526f16bb (diff) |
Adding create community and post buttons from sidebar.
- Fixes #148
Diffstat (limited to 'ui/src/components/create-post.tsx')
-rw-r--r-- | ui/src/components/create-post.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/src/components/create-post.tsx b/ui/src/components/create-post.tsx index 1958be72..fdee01f6 100644 --- a/ui/src/components/create-post.tsx +++ b/ui/src/components/create-post.tsx @@ -26,7 +26,9 @@ export class CreatePost extends Component<any, any> { } get prevCommunityName(): string { - if (this.props.location.state) { + if (this.props.match.params.name) { + return this.props.match.params.name; + } else if (this.props.location.state) { let lastLocation = this.props.location.state.prevPath; if (lastLocation.includes("/c/")) { return lastLocation.split("/c/")[1]; |