Add Crisp Chat Tracking for users.

This commit is contained in:
Patrick Fic
2023-10-19 14:42:29 -07:00
parent fd989bf7e4
commit a42c2d68ca
7 changed files with 32 additions and 9 deletions

View File

@@ -133,5 +133,10 @@
"title": "Release Notes for 1.1.6",
"date": "10/13/2023",
"notes": "New Feature:\r\n- Added live support chat."
},
"1.1.7": {
"title": "Release Notes for 1.1.7",
"date": "10/19/2023",
"notes": "Bug Fixes:\r\n- Minor bug fixes and improvements."
}
}

View File

@@ -1,4 +1,4 @@
const { ipcMain, app: electronApp } = require("electron");
const { ipcMain, app: electronApp, app } = require("electron");
const { default: ipcTypes } = require("../src/ipc.types");
const { store } = require("./electron-store");
@@ -63,3 +63,7 @@ ipcMain.on(ipcTypes.app.toMain.log.warn, (event, ...obj) => {
ipcMain.on(ipcTypes.app.toMain.log.error, (event, ...obj) => {
log.error(obj);
});
ipcMain.on(ipcTypes.app.toMain.getAppVersion, (event, obj) => {
event.sender.send(ipcTypes.app.toRenderer.appVersion, app.getVersion());
});

View File

@@ -271,7 +271,7 @@ function createTray() {
mainWindow.show();
mainWindow.maximize();
});
appIcon.setToolTip("ImEX RPS");
appIcon.setToolTip(`ImEX RPS ${app.getVersion()}`);
appIcon.setContextMenu(contextMenu);
return appIcon;
}

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS",
"version": "1.1.6",
"version": "1.1.7",
"main": "electron/main.js",
"homepage": "./",
"dependencies": {

View File

@@ -13,7 +13,8 @@ exports.default = {
downloadUpdates: "app_downloadUpdates",
installUpdates: "app_installupdates",
getReleaseNotes: "app_getReleaseNotes",
importJob:"app_importJob",
getAppVersion: "app_getApVersion",
importJob: "app_importJob",
log: {
info: "app_logInfo",
debug: "app_logDebug",
@@ -27,6 +28,7 @@ exports.default = {
downloadProgress: "app_downloadProgress",
signOut: "app_signOut",
setReleaseNotes: "app_setReleaseNotes",
appVersion: "app_appVersion",
},
},
store: {

View File

@@ -7,10 +7,10 @@ import {
setWatchedPaths,
setWatcherStatus,
} from "../redux/application/application.actions";
import { store } from "../redux/store";
import { GetR4PDateWithClaim, UpsertEstimate } from "./ipc-estimate-utils";
import { setScanEstimateList } from "../redux/scan/scan.actions";
import { store } from "../redux/store";
import { signOutStart } from "../redux/user/user.actions";
import { GetR4PDateWithClaim, UpsertEstimate } from "./ipc-estimate-utils";
const { ipcRenderer } = window;
console.log("----Initializing IPC Listeners in React App.");
@@ -100,3 +100,14 @@ ipcRenderer.on(
store.dispatch(setReleaseNotes(releaseNotes));
}
);
ipcRenderer.on(
ipcTypes.default.app.toRenderer.appVersion,
async (event, appversion) => {
window.$crisp.push([
"set",
"session:data",
[[["rps-version", appversion]]],
]);
}
);

View File

@@ -1,17 +1,18 @@
import { message } from "antd";
import moment from "moment";
//import LogRocket from "logrocket";
import * as Sentry from "@sentry/electron";
import { all, call, delay, put, takeLatest } from "redux-saga/effects";
import {
auth,
getCurrentUser,
updateCurrentUser,
} from "../../firebase/firebase.utils";
import client from "../../graphql/GraphQLClient";
import {
QUERY_BODYSHOP,
QUERY_NOTIFICATIONS,
} from "../../graphql/bodyshop.queries";
import client from "../../graphql/GraphQLClient";
import { UPSERT_USER } from "../../graphql/user.queries";
import ipcTypes from "../../ipc.types";
import {
@@ -29,7 +30,6 @@ import {
updateUserDetailsSuccess,
} from "./user.actions";
import UserActionTypes from "./user.types";
import * as Sentry from "@sentry/electron";
const { ipcRenderer } = window;
@@ -164,8 +164,9 @@ export function* signInSuccessSaga({ payload }) {
"user:nickname",
[payload.displayName || payload.email],
]);
window.$crisp.push(["set", "user:email", [payload.email]]);
window.$crisp.push(["set", "session:segments", [["rps-user"]]]);
ipcRenderer.send(ipcTypes.default.app.toMain.getAppVersion);
Sentry.setUser({
email: payload.email,