...
 
Commits (2)
......@@ -3,16 +3,16 @@ import Loadable from 'utilities/CustomReactLoadable';
const publicRoutes = [
{
path: '/wiews/:filterCode(v.+)?',
path: '/wiews/:wiewsCode([a-zA-Z]+[0-9]+)',
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "institutes" */'institutes/ui/BrowsePage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "institutes" */'institutes/ui/DisplayPage'),
}),
exact: true,
},
{
path: '/wiews/:wiewsCode([a-zA-Z]+[0-9]+)',
path: '/wiews/:filterCode(v.+)?',
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "institutes" */'institutes/ui/DisplayPage'),
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "institutes" */'institutes/ui/BrowsePage'),
}),
exact: true,
},
......
......@@ -118,8 +118,10 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
}
public componentWillMount() {
const { code, loadInstitute, userRoles } = this.props;
loadInstitute(code);
const { code, loadInstitute, institute, userRoles } = this.props;
if (code && (! institute || code !== institute.details.code)) {
loadInstitute(code);
}
const authenticated: boolean = userRoles.findIndex((role) => role === 'ROLE_USER') !== -1;
this.setState({authenticated});
......