diff --git a/app/client/src/pages/organization/AppInviteUsersForm.tsx b/app/client/src/pages/organization/AppInviteUsersForm.tsx index 0f22b81c60..acd139e614 100644 --- a/app/client/src/pages/organization/AppInviteUsersForm.tsx +++ b/app/client/src/pages/organization/AppInviteUsersForm.tsx @@ -15,6 +15,7 @@ import OrgInviteUsersForm from "./OrgInviteUsersForm"; import { getCurrentUser } from "selectors/usersSelectors"; import Text, { TextType } from "components/ads/Text"; import Toggle from "components/ads/Toggle"; +import { ANONYMOUS_USERNAME } from "constants/userConstants"; const Title = styled.div` padding: 10px 0px; @@ -65,7 +66,7 @@ const AppInviteUsersForm = (props: any) => { }; useEffect(() => { - if (currentUser.name !== "anonymousUser") { + if (currentUser.name !== ANONYMOUS_USERNAME) { fetchCurrentOrg(props.orgId); } }, [props.orgId, fetchCurrentOrg, currentUser.name]); diff --git a/app/client/src/sagas/userSagas.tsx b/app/client/src/sagas/userSagas.tsx index 6567b552a1..a155f35241 100644 --- a/app/client/src/sagas/userSagas.tsx +++ b/app/client/src/sagas/userSagas.tsx @@ -36,6 +36,7 @@ import { INVITE_USERS_TO_ORG_FORM } from "constants/forms"; import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; +import { ANONYMOUS_USERNAME } from "constants/userConstants"; export function* createUserSaga( action: ReduxActionWithPromise, @@ -83,7 +84,7 @@ export function* getCurrentUserSaga() { const response: ApiResponse = yield call(UserApi.getCurrentUser); const isValidResponse = yield validateResponse(response); - if (isValidResponse) { + if (isValidResponse && response.data.username !== ANONYMOUS_USERNAME) { AnalyticsUtil.identifyUser(response.data.username, response.data); if (window.location.pathname === BASE_URL) { if (response.data.isAnonymous) { diff --git a/app/client/src/utils/AnalyticsUtil.tsx b/app/client/src/utils/AnalyticsUtil.tsx index cd1086abe0..3bc510b916 100644 --- a/app/client/src/utils/AnalyticsUtil.tsx +++ b/app/client/src/utils/AnalyticsUtil.tsx @@ -185,9 +185,8 @@ class AnalyticsUtil { } if (windowDoc.analytics) { windowDoc.analytics.track(eventName, finalEventData); - } else { - log.debug("Event fired", eventName, finalEventData); } + log.debug("Event fired", eventName, finalEventData); } static identifyUser(userId: string, userData: User) {