1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Refactor platform properties loading

This commit is contained in:
James Salter
2021-07-21 18:35:25 +01:00
parent 585b702652
commit c34afdb4bd
3 changed files with 36 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ import { Jitsi } from "./widgets/Jitsi";
import { SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY, SSO_IDP_ID_KEY } from "./BasePlatform";
import ThreepidInviteStore from "./stores/ThreepidInviteStore";
import CountlyAnalytics from "./CountlyAnalytics";
import { getAnalytics } from "./PosthogAnalytics";
import { Anonymity, getAnalytics, getPlatformProperties } from "./PosthogAnalytics";
import CallHandler from './CallHandler';
import LifecycleCustomisations from "./customisations/Lifecycle";
import ErrorDialog from "./components/views/dialogs/ErrorDialog";
@@ -574,6 +574,14 @@ async function doSetLoggedIn(
await abortLogin();
}
if (SettingsStore.getValue("analyticsOptIn")) {
const analytics = getAnalytics();
analytics.setAnonymity(Anonymity.Pseudonymous);
await analytics.identifyUser(credentials.userId);
} else {
getAnalytics().setAnonymity(Anonymity.Anonymous);
}
Analytics.setLoggedIn(credentials.guest, credentials.homeserverUrl);
MatrixClientPeg.replaceUsingCreds(credentials);