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 = {
|
||||
emailEnabled: !ConfigStore.getSettingAsBoolean('ByPassEmail', false)
|
||||
};
|
||||
|
||||
if (!this.state.emailEnabled) {
|
||||
this.props.state.wizard = 'username';
|
||||
this.props.updateParent(this.props.state);
|
||||
}
|
||||
}
|
||||
submitBack(e) {
|
||||
e.preventDefault();
|
||||
@@ -75,12 +80,6 @@ export default class TeamSignupSendInvitesPage extends React.Component {
|
||||
this.submitNext(e);
|
||||
}
|
||||
}
|
||||
componentWillMount() {
|
||||
if (!this.state.emailEnabled) {
|
||||
this.props.state.wizard = 'username';
|
||||
this.props.updateParent(this.props.state);
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
if (!this.state.emailEnabled) {
|
||||
// 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.state = {useDiff: false};
|
||||
|
||||
document.addEventListener('keyup', this.handleKeyPress, false);
|
||||
}
|
||||
submitNext(e) {
|
||||
if (!BrowserStore.isLocalStorageSupported()) {
|
||||
@@ -68,9 +70,6 @@ export default class TeamSignupWelcomePage extends React.Component {
|
||||
this.submitNext(event);
|
||||
}
|
||||
}
|
||||
componentWillMount() {
|
||||
document.addEventListener('keyup', this.handleKeyPress, false);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('keyup', this.handleKeyPress, false);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user