mario-core 2.9.31-beta → 2.9.33-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +30 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -7,6 +7,7 @@ import { object, string, boolean, number, array } from 'yup';
|
|
|
7
7
|
import { useDispatch, useSelector } from 'react-redux';
|
|
8
8
|
import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
|
|
9
9
|
import axios from 'axios';
|
|
10
|
+
import amplitude from 'amplitude-js';
|
|
10
11
|
import { useGoogleReCaptcha, GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
|
|
11
12
|
import GoogleLogin from 'react-google-login';
|
|
12
13
|
import Select from 'react-select';
|
|
@@ -26,7 +27,6 @@ import ReactNotification$1 from 'react-notifications-component';
|
|
|
26
27
|
import 'react-notifications-component/dist/theme.css';
|
|
27
28
|
import { AiOutlineEye } from 'react-icons/ai';
|
|
28
29
|
import moment from 'moment';
|
|
29
|
-
import amplitude from 'amplitude-js';
|
|
30
30
|
|
|
31
31
|
// A type of promise-like that resolves synchronously and supports only one observer
|
|
32
32
|
|
|
@@ -301,6 +301,16 @@ var apiUpload = axios.create({
|
|
|
301
301
|
Object.keys(localStorage).forEach(function (key) {
|
|
302
302
|
if (!key.includes('learning-plan')) delete localStorage[key];
|
|
303
303
|
});
|
|
304
|
+
var userEmail = localStorage.getItem("USER_EMAIL");
|
|
305
|
+
|
|
306
|
+
if (userEmail) {
|
|
307
|
+
amplitude.getInstance().logEvent("general: session end", {
|
|
308
|
+
user_id: userEmail
|
|
309
|
+
});
|
|
310
|
+
amplitude.getInstance().resetSessionId();
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
localStorage.setItem("USER_EMAIL", "");
|
|
304
314
|
window.location.href = "/login";
|
|
305
315
|
}
|
|
306
316
|
|
|
@@ -414,7 +424,8 @@ var useLogin = function useLogin() {
|
|
|
414
424
|
lastName = _res$data.lastName,
|
|
415
425
|
roles = _res$data.roles,
|
|
416
426
|
email = _res$data.email,
|
|
417
|
-
profileImageFileName = _res$data.profileImageFileName
|
|
427
|
+
profileImageFileName = _res$data.profileImageFileName,
|
|
428
|
+
isLoginFirst = _res$data.isLoginFirst;
|
|
418
429
|
localStorage.setItem(ACCESS_TOKEN, token);
|
|
419
430
|
dispatch(setUser({
|
|
420
431
|
id: id,
|
|
@@ -425,6 +436,23 @@ var useLogin = function useLogin() {
|
|
|
425
436
|
profileImageFileName: profileImageFileName
|
|
426
437
|
}));
|
|
427
438
|
|
|
439
|
+
if (data !== null && data !== void 0 && data.email && !roles.includes("Admin")) {
|
|
440
|
+
amplitude.getInstance().init(INIT_AMPLITUDE_KEY, data.email, {
|
|
441
|
+
includeReferrer: true,
|
|
442
|
+
includeUtm: true
|
|
443
|
+
});
|
|
444
|
+
amplitude.getInstance().logEvent("general: session start", {
|
|
445
|
+
user_id: data.email
|
|
446
|
+
});
|
|
447
|
+
localStorage.setItem("USER_EMAIL", data.email);
|
|
448
|
+
|
|
449
|
+
if (isLoginFirst) {
|
|
450
|
+
amplitude.getInstance().logEvent("general: first login", {
|
|
451
|
+
user_id: data.email
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
428
456
|
if (isDistrict) {
|
|
429
457
|
history.push(HOMEPAGE_DISTRICT);
|
|
430
458
|
} else if (roles.includes("Admin")) {
|