@jetshop/core 6.1.1 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -193,10 +193,12 @@ export function trackerRegistry({ config, inServer }) {
|
|
193
193
|
},
|
194
194
|
add(tracker) {
|
195
195
|
if (trackers.find(({ name }) => name === tracker.name)) {
|
196
|
-
|
196
|
+
console.error(`Tracker with name "${tracker.name}" is already registered,
|
197
|
+
check client setup.`);
|
197
198
|
}
|
198
199
|
if (initialized) {
|
199
|
-
|
200
|
+
console.error(`Tried adding tracker "${tracker.name}" after trackers already have been initialized,
|
201
|
+
check your implementation.`);
|
200
202
|
}
|
201
203
|
trackers.push(tracker);
|
202
204
|
// Auto-bind built-in events
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"trackerRegistry.js","sourceRoot":"","sources":["trackerRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,aAAa,MAAM,eAAe,CAAC;AAmJ1C,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D,SAAS;IACT,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,YAAY;IACZ,eAAe;IACf,oBAAoB;CACrB,CAAC;AA6BF,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,oBAAoB,EACpB,OAAO,EACP,KAAK,EAMN;IACC,MAAM,QAAQ,GAAG;QACf,oBAAoB;QACpB,QAAQ;QACR,OAAO;QACP,KAAK;KACN,CAAC;IACF,MAAM,aAAa,GAAY;QAC7B,IAAI,EAAE,QAAQ;QACd,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO;YAClC,KAAK,CAAC,4BAA4B,EAAE;gBAClC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,iCACf,QAAQ,KACX,OAAO;oBACP,KAAK;oBACL,OAAO,EACP,QAAQ,EAAE,MAAM,CAAC,Q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AAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,CAAC,IAAI,cAAc,EAAE;oBACjD,GAAG;oBACH,IAAI;iBACL,CAAC,CAAC;aACJ;QACH,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KAChD,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import useAuth from '@jetshop/core/components/AuthContext/useAuth';
|
2
|
-
import React from 'react';
|
2
|
+
import React, { useEffect } from 'react';
|
3
3
|
import { Redirect } from 'react-router-dom';
|
4
4
|
import { useLocation } from 'react-router';
|
5
5
|
function LogOut({ logOutRedirectPath }) {
|
6
6
|
const { loggedIn, logOut } = useAuth();
|
7
7
|
const location = useLocation();
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
useEffect(() => {
|
9
|
+
if (loggedIn) {
|
10
|
+
logOut();
|
11
|
+
}
|
12
|
+
}, [loggedIn, logOut]);
|
11
13
|
const logOutPath = logOutRedirectPath || '/';
|
12
|
-
return (React.createElement(Redirect, { to: Object.assign(Object.assign({}, location), { pathname: logOutPath }) }));
|
14
|
+
return loggedIn ? (React.createElement(Redirect, { to: Object.assign(Object.assign({}, location), { pathname: logOutPath }) })) : null;
|
13
15
|
}
|
14
16
|
export default LogOut;
|
15
17
|
//# sourceMappingURL=LogOut.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LogOut.js","sourceRoot":"","sources":["LogOut.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,8CAA8C,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"LogOut.js","sourceRoot":"","sources":["LogOut.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,8CAA8C,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,SAAS,MAAM,CAAC,EAAE,kBAAkB,EAAkC;IACpE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,EAAE;YACZ,MAAM,EAAE,CAAC;SACV;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvB,MAAM,UAAU,GAAG,kBAAkB,IAAI,GAAG,CAAC;IAE7C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,oBAAC,QAAQ,IACP,EAAE,kCACG,QAAQ,KACX,QAAQ,EAAE,UAAU,MAEtB,CACH,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,eAAe,MAAM,CAAC"}
|