Moved componentWillMount logic into the constructor of the react components it was used in
Этот коммит содержится в:
@@ -18,6 +18,11 @@ export default class TeamSignupSendInvitesPage extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
|
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!this.state.emailEnabled) {
|
||||||
|
this.props.state.wizard = 'username';
|
||||||
|
this.props.updateParent(this.props.state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
submitBack(e) {
|
submitBack(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -75,12 +80,6 @@ export default class TeamSignupSendInvitesPage extends React.Component {
|
|||||||
this.submitNext(e);
|
this.submitNext(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount() {
|
|
||||||
if (!this.state.emailEnabled) {
|
|
||||||
this.props.state.wizard = 'username';
|
|
||||||
this.props.updateParent(this.props.state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.state.emailEnabled) {
|
if (!this.state.emailEnabled) {
|
||||||
// Must use keypress not keyup due to event chain of pressing enter
|
// Must use keypress not keyup due to event chain of pressing enter
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ export default class TeamSignupWelcomePage extends React.Component {
|
|||||||
this.handleKeyPress = this.handleKeyPress.bind(this);
|
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||||
|
|
||||||
this.state = {useDiff: false};
|
this.state = {useDiff: false};
|
||||||
|
|
||||||
|
document.addEventListener('keyup', this.handleKeyPress, false);
|
||||||
}
|
}
|
||||||
submitNext(e) {
|
submitNext(e) {
|
||||||
if (!BrowserStore.isLocalStorageSupported()) {
|
if (!BrowserStore.isLocalStorageSupported()) {
|
||||||
@@ -68,9 +70,6 @@ export default class TeamSignupWelcomePage extends React.Component {
|
|||||||
this.submitNext(event);
|
this.submitNext(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillMount() {
|
|
||||||
document.addEventListener('keyup', this.handleKeyPress, false);
|
|
||||||
}
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
document.removeEventListener('keyup', this.handleKeyPress, false);
|
document.removeEventListener('keyup', this.handleKeyPress, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user