You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
PosthogAnalytics unwatch settings on logout (#11207)
* PosthogAnalytics unwatch settings on logout * Tidy
This commit is contained in:
committed by
GitHub
parent
411a63f4a5
commit
ab972ddea9
@@ -748,11 +748,12 @@ let _isLoggingOut = false;
|
||||
* Logs the current session out and transitions to the logged-out state
|
||||
*/
|
||||
export function logout(): void {
|
||||
if (!MatrixClientPeg.get()) return;
|
||||
const client = MatrixClientPeg.get();
|
||||
if (!client) return;
|
||||
|
||||
PosthogAnalytics.instance.logout();
|
||||
|
||||
if (MatrixClientPeg.get()!.isGuest()) {
|
||||
if (client.isGuest()) {
|
||||
// logout doesn't work for guest sessions
|
||||
// Also we sometimes want to re-log in a guest session if we abort the login.
|
||||
// defer until next tick because it calls a synchronous dispatch, and we are likely here from a dispatch.
|
||||
@@ -761,7 +762,6 @@ export function logout(): void {
|
||||
}
|
||||
|
||||
_isLoggingOut = true;
|
||||
const client = MatrixClientPeg.get()!;
|
||||
PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? "");
|
||||
client.logout(true).then(onLoggedOut, (err) => {
|
||||
// Just throwing an error here is going to be very unhelpful
|
||||
|
Reference in New Issue
Block a user