set userid regardless of signin
This commit is contained in:
parent
fab03d337e
commit
51c94d334a
2 changed files with 6 additions and 3 deletions
|
@ -130,6 +130,7 @@ function App(props: Props) {
|
|||
const rawReferrerParam = urlParams.get('r');
|
||||
const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#');
|
||||
const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`);
|
||||
const userId = user && user.id;
|
||||
|
||||
let uri;
|
||||
try {
|
||||
|
@ -142,6 +143,11 @@ function App(props: Props) {
|
|||
setShowAnalyticsNag(false);
|
||||
}
|
||||
// @endif
|
||||
useEffect(() => {
|
||||
if (userId) {
|
||||
analytics.setUser(userId);
|
||||
}
|
||||
}, [userId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!uploadCount) return;
|
||||
|
|
|
@ -529,11 +529,8 @@ export function doSignIn() {
|
|||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
const user = selectUser(state);
|
||||
const userId = user.id;
|
||||
const notificationsEnabled = user.experimental_ui;
|
||||
|
||||
analytics.setUser(userId);
|
||||
|
||||
if (notificationsEnabled) {
|
||||
dispatch(doSocketConnect());
|
||||
dispatch(doNotificationList());
|
||||
|
|
Loading…
Reference in a new issue