Add some more autobinds
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react'
|
|||||||
import { api } from 'src/API'
|
import { api } from 'src/API'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { MessageModal, WaitModal } from '../Modal'
|
import { MessageModal, WaitModal } from '../Modal'
|
||||||
|
import autobind from 'autobind-decorator'
|
||||||
|
|
||||||
export class ConfirmEmail extends React.Component {
|
export class ConfirmEmail extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -13,7 +14,6 @@ export class ConfirmEmail extends React.Component {
|
|||||||
waitModal: null,
|
waitModal: null,
|
||||||
messageModal: null
|
messageModal: null
|
||||||
}
|
}
|
||||||
this.handleMessageModalDismiss = this.handleMessageModalDismiss.bind(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(props) {
|
componentDidMount(props) {
|
||||||
@@ -47,6 +47,7 @@ export class ConfirmEmail extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
handleMessageModalDismiss() {
|
handleMessageModalDismiss() {
|
||||||
this.setState({ messageModal: null })
|
this.setState({ messageModal: null })
|
||||||
this.props.history.replace('/login')
|
this.props.history.replace('/login')
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react'
|
|||||||
import { Route, Redirect } from 'react-router-dom'
|
import { Route, Redirect } from 'react-router-dom'
|
||||||
import { PropTypes } from 'prop-types'
|
import { PropTypes } from 'prop-types'
|
||||||
import { api } from 'src/API'
|
import { api } from 'src/API'
|
||||||
|
import autobind from 'autobind-decorator'
|
||||||
|
|
||||||
export class ProtectedRoute extends React.Component {
|
export class ProtectedRoute extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -15,11 +16,7 @@ export class ProtectedRoute extends React.Component {
|
|||||||
roles: ['administrator']
|
roles: ['administrator']
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
@autobind
|
||||||
super(props)
|
|
||||||
this.updateComponent = this.updateComponent.bind(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
updateComponent() {
|
updateComponent() {
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
|
|||||||
import { Column, Button, BoundInput, BoundButton } from 'ui'
|
import { Column, Button, BoundInput, BoundButton } from 'ui'
|
||||||
import { regExpPattern } from 'regexp-pattern'
|
import { regExpPattern } from 'regexp-pattern'
|
||||||
import { FormBinder } from 'react-form-binder'
|
import { FormBinder } from 'react-form-binder'
|
||||||
|
import autobind from 'autobind-decorator'
|
||||||
|
|
||||||
export class ProfileForm extends React.Component {
|
export class ProfileForm extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -62,8 +63,6 @@ export class ProfileForm extends React.Component {
|
|||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.handleSubmit = this.handleSubmit.bind(this)
|
|
||||||
this.state = {
|
this.state = {
|
||||||
binder: new FormBinder(
|
binder: new FormBinder(
|
||||||
this.props.user, ProfileForm.bindings, this.props.onModifiedChanged)
|
this.props.user, ProfileForm.bindings, this.props.onModifiedChanged)
|
||||||
@@ -79,6 +78,7 @@ export class ProfileForm extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@autobind
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user