mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
fix logout.
This commit is contained in:
@@ -25,6 +25,13 @@ export default class Analytics {
|
||||
posthog.identify(email.toString());
|
||||
}
|
||||
|
||||
public logout(): void {
|
||||
if (!this.isInitialized) {
|
||||
return;
|
||||
}
|
||||
posthog.reset();
|
||||
}
|
||||
|
||||
public capture(eventName: string, data?: JSONObject): void {
|
||||
if (!this.isInitialized) {
|
||||
return;
|
||||
|
||||
@@ -8,11 +8,13 @@ import PageLoader from 'CommonUI/src/Components/Loader/PageLoader';
|
||||
import UserUtil from 'CommonUI/src/Utils/User';
|
||||
import Navigation from 'CommonUI/src/Utils/Navigation';
|
||||
import { ACCOUNTS_URL } from 'CommonUI/src/Config';
|
||||
import UiAnalytics from 'CommonUI/src/Utils/Analytics';
|
||||
|
||||
const Logout: FunctionComponent<PageComponentProps> = (
|
||||
_props: PageComponentProps
|
||||
): ReactElement => {
|
||||
useEffect(() => {
|
||||
UiAnalytics.logout();
|
||||
UserUtil.logout();
|
||||
Navigation.navigate(ACCOUNTS_URL);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user