Added logrocket dependencies.

This commit is contained in:
Patrick Fic
2020-04-22 14:54:58 -07:00
parent 678f09b47a
commit e17c41a3dc
5 changed files with 17 additions and 13 deletions

View File

@@ -20,6 +20,7 @@
"graphql": "^15.0.0",
"i18next": "^19.4.3",
"i18next-browser-languagedetector": "^4.1.1",
"logrocket": "^1.0.7",
"node-sass": "^4.13.1",
"query-string": "^6.12.1",
"react": "^16.13.1",

View File

@@ -14,6 +14,10 @@ import GlobalLoadingBar from "../components/global-loading-bar/global-loading-ba
import { auth } from "../firebase/firebase.utils";
import errorLink from "../graphql/apollo-error-handling";
import App from "./App";
import LogRocket from 'logrocket';
LogRocket.init('gvfvfw/bodyshopapp');
export default class AppContainer extends Component {
constructor() {
super();

View File

@@ -1,4 +1,3 @@
import i18next from "i18next";
import React, { lazy, Suspense, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -37,11 +36,6 @@ export default connect(
}, [checkUserSession]);
const { t } = useTranslation();
if (currentUser && currentUser.language)
i18next.changeLanguage(currentUser.language, err => {
if (err)
return console.log("Error encountered when changing languages.", err);
});
if (currentUser.authorized === null) {
return <LoadingSpinner message={t("general.labels.loggingin")} />;

View File

@@ -1,8 +1,9 @@
import { all, call, put, takeLatest } from "redux-saga/effects";
import LogRocket from "logrocket";
import {
auth,
getCurrentUser,
updateCurrentUser
updateCurrentUser,
} from "../../firebase/firebase.utils";
import {
signInFailure,
@@ -10,7 +11,7 @@ import {
signOutFailure,
signOutSuccess,
unauthorizedUser,
updateUserDetailsSuccess
updateUserDetailsSuccess,
} from "./user.actions";
import UserActionTypes from "./user.types";
@@ -23,7 +24,7 @@ export function* signInWithEmail({ payload: { email, password } }) {
email: user.email,
displayName: user.displayName,
photoURL: user.photoURL,
authorized: true
authorized: true,
})
);
} catch (error) {
@@ -42,13 +43,14 @@ export function* isUserAuthenticated() {
yield put(unauthorizedUser());
return;
}
LogRocket.identify(user.email);
yield put(
signInSuccess({
uid: user.uid,
email: user.email,
displayName: user.displayName,
photoURL: user.photoURL,
authorized: true
authorized: true,
})
);
} catch (error) {
@@ -92,6 +94,6 @@ export function* userSagas() {
call(onEmailSignInStart),
call(onCheckUserSession),
call(onSignOutStart),
call(onUpdateUserDetails)
call(onUpdateUserDetails),
]);
}

View File

@@ -8173,6 +8173,11 @@ loglevel@^1.6.6:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.7.tgz#b3e034233188c68b889f5b862415306f565e2c56"
integrity sha512-cY2eLFrQSAfVPhCgH1s7JI73tMbg9YC3v3+ZHVW67sBS7UxWzNEk/ZBbSfLykBWHp33dqqtOv82gjhKEi81T/A==
logrocket@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/logrocket/-/logrocket-1.0.7.tgz#fe17dbdfc861481cd274fbda533d552de7800a3a"
integrity sha512-v6HWEQIsyG+3FkldB7vIAgHh7/qpsiz2Br4bLK5SHBvjqRrHs/Fp+Jr8oiA2GYq0UurAtCu51U8SWft5+OCKtg==
long@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
@@ -11768,8 +11773,6 @@ rxjs@^6.5.3:
version "6.5.4"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c"
integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==
dependencies:
tslib "^1.9.0"
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"