Fix #125 Maintenance mode

This commit is contained in:
ivan 2018-01-03 20:08:04 -03:00
parent 8e6d28fff8
commit 0837754ffb
4 changed files with 10 additions and 7 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@ server/composer.lock
server/vendor
.idea
.jshintrc
server/files/
!server/files/.gitkeep

View File

@ -2,7 +2,7 @@
module.exports = {
'serverport': 3000,
'serverport': 3006,
'scripts': {
'src': './src/*.js',

View File

@ -65,11 +65,11 @@ class App extends React.Component {
loggedOutStaff: _.includes(props.location.pathname, '/admin/panel') && !props.session.logged
};
if(props.config['maintenance-mode'] === '1' && !_.includes(props.location.pathname, '/admin') && !_.includes(props.location.pathname, '/maintenance')) {
if(props.config['maintenance-mode'] && !_.includes(props.location.pathname, '/admin') && !_.includes(props.location.pathname, '/maintenance')) {
history.push('/maintenance');
}
if(props.config['maintenance-mode'] === '0' && _.includes(props.location.pathname, '/maintenance')) {
if(!props.config['maintenance-mode'] && _.includes(props.location.pathname, '/maintenance')) {
history.push('/');
}

View File

@ -60,6 +60,7 @@ class SessionStore {
this.setItem('registration', configs.registration);
this.setItem('user-system-enabled', configs['user-system-enabled']);
this.setItem('allow-attachments', configs['allow-attachments']);
this.setItem('maintenance-mode', configs['maintenance-mode']);
}
getConfigs() {