diff --git a/client/src/landing/index.jsx b/client/src/landing/index.jsx index 420629bd1..f9f3a09be 100644 --- a/client/src/landing/index.jsx +++ b/client/src/landing/index.jsx @@ -58,6 +58,13 @@ export default class Home extends React.Component { }, 500); } /* 如果不是 dva 2.0 请删除 end */ + console.log("Setting $crisp segments", ["lead"]); + window.$crisp.push(["set", "session:segments", [["lead"]]]); + window.$crisp.push([ + "set", + "session:event", + [[["landing-page", {}, "green"]]], + ]); } render() { diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js index d52834159..f5a6cc54c 100644 --- a/client/src/redux/user/user.sagas.js +++ b/client/src/redux/user/user.sagas.js @@ -166,11 +166,14 @@ export function* signInSuccessSaga({ payload }) { LogRocket.identify(payload.email); try { // window.$crisp.push(["set", "user:email", [payload.email]]); + console.log("$crisp set nickname", [payload.displayName || payload.email]); window.$crisp.push([ "set", "user:nickname", [payload.displayName || payload.email], ]); + console.log("Setting $crisp segments", ["user"]); + window.$crisp.push(["set", "session:segments", [["user"]]]); } catch (error) { console.log("Error updating Crisp settings.", error); } diff --git a/client/src/translations/i18n.js b/client/src/translations/i18n.js index e9cbc3157..49418381e 100644 --- a/client/src/translations/i18n.js +++ b/client/src/translations/i18n.js @@ -1,9 +1,9 @@ import i18n from "i18next"; -import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; +import { initReactI18next } from "react-i18next"; import en_Translation from "./en_us/common.json"; -import fr_Translation from "./fr/common.json"; import es_Translation from "./es/common.json"; +import fr_Translation from "./fr/common.json"; // the translations // (tip move them in a JSON file and import them) @@ -23,9 +23,7 @@ i18n debug: process.env.NODE_ENV === "production" ? false : true, //keySeparator: false, // we do not use keys in form messages.welcome - react: { - wait: true, - }, + interpolation: { escapeValue: false, // react already safes from xss },