File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,13 @@ class Layout extends Component {
1818 }
1919}
2020
21- const mapStateToProps = ( { loadUser } ) => {
21+ const mapStateToProps = ( { loadUser, projectState, projectSearch } ) => {
22+ const projectDetailApiCheck = ! projectState . isLoading && ! ! projectState . error && projectState . error . code === 404
23+ const projectListingApiCheck = ! projectSearch . isLoading && ! ! projectSearch . error
2224 return {
2325 user : loadUser . user ,
24- isLoadingUser : loadUser . isLoading
26+ isLoadingUser : loadUser . isLoading ,
27+ maintenanceMode : projectDetailApiCheck || projectListingApiCheck
2528 }
2629}
2730
Original file line number Diff line number Diff line change 11import React from 'react'
22import Footer from '../Footer/Footer'
3- import { MAINTENANCE_MODE } from '../../config/constants'
3+ // import { MAINTENANCE_MODE } from '../../config/constants'
44import Alert from 'react-s-alert'
55import cn from 'classnames'
66import Maintenance from '../Maintenance/Maintenance'
@@ -12,11 +12,11 @@ import '../../styles/vendors/s-alert-default.css'
1212import 'react-s-alert/dist/s-alert-css-effects/slide.css'
1313
1414const Layout = ( props ) => {
15- const { isLoadingUser } = props
15+ const { isLoadingUser, maintenanceMode } = props
1616
1717 if ( isLoadingUser ) {
1818 return ( < div /> )
19- } else if ( MAINTENANCE_MODE ) {
19+ } else if ( maintenanceMode ) {
2020 return < Maintenance />
2121 } else {
2222 return (
Original file line number Diff line number Diff line change @@ -29,9 +29,10 @@ const initialState = {
2929
3030const parseErrorObj = ( action ) => {
3131 const data = _ . get ( action . payload , 'response.data.result' )
32+ const httpStatus = _ . get ( action . payload , 'response.status' )
3233 return {
3334 type : action . type ,
34- code : _ . get ( data , 'status' , 500 ) ,
35+ code : _ . get ( data , 'status' , httpStatus || 500 ) ,
3536 msg : _ . get ( data , 'content.message' , '' ) ,
3637 details : JSON . parse ( _ . get ( data , 'details' , null ) )
3738 }
You can’t perform that action at this time.
0 commit comments