1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Merge pull request #5370 from matrix-org/t3chguy/countly

Fix CountlyAnalytics NPE on MatrixClientPeg
This commit is contained in:
Michael Telatynski
2020-10-30 14:28:48 +00:00
committed by GitHub
3 changed files with 5 additions and 7 deletions

View File

@@ -350,10 +350,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
if (SettingsStore.getValue("analyticsOptIn")) {
Analytics.enable();
CountlyAnalytics.instance.enable(false);
} else {
CountlyAnalytics.instance.enable(true);
}
CountlyAnalytics.instance.enable(/* anonymous = */ true);
}
// TODO: [REACT-WARNING] Replace with appropriate lifecycle stage
@@ -422,7 +420,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
dis.dispatch({action: "view_welcome_page"});
}
} else if (SettingsStore.getValue("analyticsOptIn")) {
CountlyAnalytics.instance.enable(false);
CountlyAnalytics.instance.enable(/* anonymous = */ false);
}
});
// Note we don't catch errors from this: we catch everything within
@@ -762,7 +760,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
Analytics.enable();
}
if (CountlyAnalytics.instance.canEnable()) {
CountlyAnalytics.instance.enable(false);
CountlyAnalytics.instance.enable(/* anonymous = */ false);
}
break;
case 'reject_cookies':

View File

@@ -103,7 +103,7 @@ export default class SecurityUserSettingsTab extends React.Component {
_updateAnalytics = (checked) => {
checked ? Analytics.enable() : Analytics.disable();
CountlyAnalytics.instance.enable(!checked);
CountlyAnalytics.instance.enable(/* anonymous = */ !checked);
};
_onExportE2eKeysClicked = () => {