Merge branch 'release/2022-10-31' into feature/pbs-ap

* release/2022-10-31:
  Improved LR activiation.
  Improved LR tracking.
This commit is contained in:
Patrick Fic
2022-10-31 11:34:56 -07:00

View File

@@ -1,4 +1,4 @@
import { useTreatments } from "@splitsoftware/splitio-react"; import { useClient } from "@splitsoftware/splitio-react";
import { Button, Result } from "antd"; import { Button, Result } from "antd";
import LogRocket from "logrocket"; import LogRocket from "logrocket";
import React, { lazy, Suspense, useEffect } from "react"; import React, { lazy, Suspense, useEffect } from "react";
@@ -51,11 +51,7 @@ export function App({
online, online,
setOnline, setOnline,
}) { }) {
const { LogRocket_Tracking } = useTreatments( const client = useClient();
["LogRocket_Tracking"],
{},
bodyshop && bodyshop.imexshopid
);
useEffect(() => { useEffect(() => {
if (!navigator.onLine) { if (!navigator.onLine) {
@@ -78,15 +74,15 @@ export function App({
setOnline(true); setOnline(true);
}); });
useEffect(() => { useEffect(() => {
if (currentUser.authorized) { if (currentUser.authorized && bodyshop) {
if ( client.setAttribute("imexshopid", bodyshop.imexshopid);
process.env.NODE_ENV === "production" &&
LogRocket_Tracking.treatment === "on" if (client.getTreatment("LogRocket_Tracking") === "on") {
) { console.log("LR Start");
LogRocket.init("gvfvfw/bodyshopapp"); LogRocket.init("gvfvfw/bodyshopapp");
} }
} }
}, [currentUser.authorized, LogRocket_Tracking.treatment]); }, [bodyshop, client, currentUser.authorized]);
if (currentUser.authorized === null) { if (currentUser.authorized === null) {
return <LoadingSpinner message={t("general.labels.loggingin")} />; return <LoadingSpinner message={t("general.labels.loggingin")} />;