If not specified redirect to 'all' tab

This commit is contained in:
Chi Vinh Le
2017-06-23 18:11:54 +07:00
parent bb544a92b3
commit e89a15f2d2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import React from 'react';
import {Router, Route, IndexRedirect, browserHistory} from 'react-router';
import {Router, Route, IndexRedirect, browserHistory, Redirect} from 'react-router';
import Configure from 'routes/Configure';
import Dashboard from 'routes/Dashboard';
@@ -49,7 +49,7 @@ const routes = (
<Route path='flagged' components={Moderation}>
<Route path=':id' components={Moderation} />
</Route>
<Route path=':id' components={Moderation} />
<Redirect from=':id' to='all/:id' />
<IndexRedirect to='all' />
</Route>
</Route>
@@ -41,7 +41,7 @@ function prepareNotificationText(text) {
class ModerationContainer extends Component {
subscriptions = [];
get activeTab() { return this.props.route.path === ':id' ? 'premod' : this.props.route.path; }
get activeTab() { return this.props.route.path; }
subscribeToUpdates(variables = this.props.data.variables) {
const sub1 = this.props.data.subscribeToMore({