Merge pull request #101 from edx/adeel/moving_events_call_to_component_constructor
Fix multiple event firing on rerenders.
This commit is contained in:
@@ -32,6 +32,7 @@ class LoginPage extends React.Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
|
||||
sendPageEvent('login_and_registration', 'login');
|
||||
this.state = {
|
||||
password: '',
|
||||
email: '',
|
||||
@@ -170,7 +171,6 @@ class LoginPage extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
sendPageEvent('login_and_registration', 'login');
|
||||
return (
|
||||
<>
|
||||
<RedirectLogistration
|
||||
|
||||
@@ -46,6 +46,7 @@ class RegistrationPage extends React.Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
|
||||
sendPageEvent('login_and_registration', 'register');
|
||||
this.intl = props.intl;
|
||||
|
||||
this.state = {
|
||||
@@ -549,7 +550,6 @@ class RegistrationPage extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
sendPageEvent('login_and_registration', 'register');
|
||||
return (
|
||||
<>
|
||||
<RedirectLogistration
|
||||
|
||||
Reference in New Issue
Block a user