Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2209 | Rev 3362 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2209 Rev 2284
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { connect } from 'react-redux'
2
import { connect } from 'react-redux'
Línea 3... Línea 3...
3
 
3
 
-
 
4
import { addNotification } from '@app/redux/notification/notification.actions'
Línea 4... Línea 5...
4
import { addNotification } from '@app/redux/notification/notification.actions'
5
import { logout } from '@app/redux/auth/auth.actions'
5
 
6
 
6
class ErrorBoundary extends React.Component {
7
class ErrorBoundary extends React.Component {
7
  constructor(props) {
8
  constructor(props) {
Línea 14... Línea 15...
14
  }
15
  }
Línea 15... Línea 16...
15
 
16
 
16
  componentDidCatch(error, errorInfo) {
17
  componentDidCatch(error, errorInfo) {
17
    console.error('ErrorBoundary caught an error: ', error, errorInfo)
18
    console.error('ErrorBoundary caught an error: ', error, errorInfo)
-
 
19
    this.props.addNotification({ style: 'danger', msg: error.message })
18
    this.props.addNotification({ style: 'danger', msg: error.message })
20
    if (error.message.includes('sesión')) this.props.logout()
Línea 19... Línea 21...
19
  }
21
  }
20
 
22
 
21
  render() {
23
  render() {
22
    return this.props.children
24
    return this.props.children
Línea 23... Línea 25...
23
  }
25
  }
24
}
26
}
-
 
27
 
25
 
28
const mapDispatchToProps = {
Línea 26... Línea 29...
26
const mapDispatchToProps = {
29
  addNotification: (notification) => addNotification(notification),