@dynamic-labs/sdk-react-core 4.18.5 → 4.18.7
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/CHANGELOG.md +34 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/index.cjs +2 -1
- package/src/index.js +2 -1
- package/src/lib/components/Button/Button.d.ts +1 -1
- package/src/lib/components/ModalHeader/ModalHeader.cjs +2 -1
- package/src/lib/components/ModalHeader/ModalHeader.js +2 -1
- package/src/lib/components/ModalHeader/ModalHeader.types.d.ts +3 -1
- package/src/lib/components/TypographyButton/TypographyButton.cjs +2 -0
- package/src/lib/components/TypographyButton/TypographyButton.js +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +7 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +8 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +2 -1
- package/src/lib/context/OnrampContext/OnrampContext.cjs +30 -24
- package/src/lib/context/OnrampContext/OnrampContext.d.ts +1 -1
- package/src/lib/context/OnrampContext/OnrampContext.js +30 -24
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +8 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +9 -1
- package/src/lib/locale/en/translation.cjs +54 -1
- package/src/lib/locale/en/translation.d.ts +53 -0
- package/src/lib/locale/en/translation.js +54 -1
- package/src/lib/shared/assets/index.d.ts +1 -0
- package/src/lib/shared/assets/session.cjs +54 -0
- package/src/lib/shared/assets/session.js +30 -0
- package/src/lib/store/state/user/user.cjs +0 -7
- package/src/lib/store/state/user/user.js +0 -7
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +3 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +3 -0
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isZKSyncEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.cjs +11 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isZKSyncEnabled/isZKSyncEnabled.js +7 -0
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +30 -3
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +31 -4
- package/src/lib/utils/hooks/useGlobalLoading/useGlobalLoading.cjs +7 -0
- package/src/lib/utils/hooks/useGlobalLoading/useGlobalLoading.js +7 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +8 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +9 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +98 -14
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +98 -14
- package/src/lib/views/EmbeddedReveal/utils/waasExport/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +53 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.d.ts +11 -0
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +48 -0
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +1 -3
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +1 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +4 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +7 -2
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +8 -3
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.cjs +15 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/EmptySessionsView.js +11 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/EmptySessionsView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.cjs +28 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/SessionManagementInfoView.js +24 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementInfoView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.cjs +33 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/SessionManagementView.js +29 -0
- package/src/lib/widgets/DynamicWidget/views/SessionManagementView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +9 -2
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +9 -2
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
|
@@ -954,6 +954,24 @@ export declare const translation: {
|
|
|
954
954
|
empty_screen: {
|
|
955
955
|
title: 'Nothing to see here yet!',
|
|
956
956
|
},
|
|
957
|
+
delete_account: {
|
|
958
|
+
title: 'Delete My Account',
|
|
959
|
+
description:
|
|
960
|
+
'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
|
|
961
|
+
backup_confirmation_embedded:
|
|
962
|
+
"I confirm I've backed up my wallet keys. If I proceed, a new wallet will be created. Any wallets or assets not backed up will be lost permanently.",
|
|
963
|
+
backup_confirmation_no_embedded:
|
|
964
|
+
'I confirm that all of my information will be deleted. If I return, a new user profile will be created. These changes cannot be undone.',
|
|
965
|
+
type_delete: 'Enter DELETE in the box below to confirm this action.',
|
|
966
|
+
cancel: 'Cancel',
|
|
967
|
+
confirm: 'Delete Account',
|
|
968
|
+
deleting: 'Deleting...',
|
|
969
|
+
type_delete_label: 'Type to confirm',
|
|
970
|
+
},
|
|
971
|
+
session_management: {
|
|
972
|
+
title: 'Security Settings',
|
|
973
|
+
session_management_button: 'Session Management',
|
|
974
|
+
},
|
|
957
975
|
}
|
|
958
976
|
*/
|
|
959
977
|
dyn_settings: {
|
|
@@ -999,6 +1017,10 @@ export declare const translation: {
|
|
|
999
1017
|
deleting: string;
|
|
1000
1018
|
type_delete_label: string;
|
|
1001
1019
|
};
|
|
1020
|
+
session_management: {
|
|
1021
|
+
title: string;
|
|
1022
|
+
session_management_button: string;
|
|
1023
|
+
};
|
|
1002
1024
|
};
|
|
1003
1025
|
/**
|
|
1004
1026
|
* @description copy keys for global wallet view
|
|
@@ -1980,6 +2002,37 @@ export declare const translation: {
|
|
|
1980
2002
|
using_hardware_wallet_toggle_label: string;
|
|
1981
2003
|
button: string;
|
|
1982
2004
|
};
|
|
2005
|
+
/**
|
|
2006
|
+
* @description copy keys for session management view
|
|
2007
|
+
* @default
|
|
2008
|
+
* {
|
|
2009
|
+
aria: {
|
|
2010
|
+
back_button_label: 'Back',
|
|
2011
|
+
info_button_label: 'Info',
|
|
2012
|
+
},
|
|
2013
|
+
title: 'Session Management',
|
|
2014
|
+
empty_sessions_view: {
|
|
2015
|
+
title: 'No active sessions found',
|
|
2016
|
+
},
|
|
2017
|
+
}
|
|
2018
|
+
*/
|
|
2019
|
+
dyn_session_management: {
|
|
2020
|
+
aria: {
|
|
2021
|
+
back_button_label: string;
|
|
2022
|
+
info_button_label: string;
|
|
2023
|
+
};
|
|
2024
|
+
title: string;
|
|
2025
|
+
empty_sessions_view: {
|
|
2026
|
+
title: string;
|
|
2027
|
+
};
|
|
2028
|
+
info_view: {
|
|
2029
|
+
title: string;
|
|
2030
|
+
description_bold: string;
|
|
2031
|
+
description_2: string;
|
|
2032
|
+
description_3: string;
|
|
2033
|
+
continue_button: string;
|
|
2034
|
+
};
|
|
2035
|
+
};
|
|
1983
2036
|
/**
|
|
1984
2037
|
* @description copy keys for sign message flow views
|
|
1985
2038
|
* @default
|
|
@@ -888,7 +888,7 @@ const translation = {
|
|
|
888
888
|
title: 'Export wallet',
|
|
889
889
|
agreement_title: 'Agree to continue',
|
|
890
890
|
prompt_for_export_title: 'Back up wallet key',
|
|
891
|
-
private_key_title: '
|
|
891
|
+
private_key_title: 'Export Key',
|
|
892
892
|
recovery_phrase_title: 'Secret recovery phrase',
|
|
893
893
|
badge_label: 'Sensitive information',
|
|
894
894
|
prompt_for_export_description: 'Your wallet is ready. Back up your key to protect your assets.',
|
|
@@ -956,6 +956,24 @@ const translation = {
|
|
|
956
956
|
empty_screen: {
|
|
957
957
|
title: 'Nothing to see here yet!',
|
|
958
958
|
},
|
|
959
|
+
delete_account: {
|
|
960
|
+
title: 'Delete My Account',
|
|
961
|
+
description:
|
|
962
|
+
'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
|
|
963
|
+
backup_confirmation_embedded:
|
|
964
|
+
"I confirm I've backed up my wallet keys. If I proceed, a new wallet will be created. Any wallets or assets not backed up will be lost permanently.",
|
|
965
|
+
backup_confirmation_no_embedded:
|
|
966
|
+
'I confirm that all of my information will be deleted. If I return, a new user profile will be created. These changes cannot be undone.',
|
|
967
|
+
type_delete: 'Enter DELETE in the box below to confirm this action.',
|
|
968
|
+
cancel: 'Cancel',
|
|
969
|
+
confirm: 'Delete Account',
|
|
970
|
+
deleting: 'Deleting...',
|
|
971
|
+
type_delete_label: 'Type to confirm',
|
|
972
|
+
},
|
|
973
|
+
session_management: {
|
|
974
|
+
title: 'Security Settings',
|
|
975
|
+
session_management_button: 'Session Management',
|
|
976
|
+
},
|
|
959
977
|
}
|
|
960
978
|
*/
|
|
961
979
|
dyn_settings: {
|
|
@@ -999,6 +1017,10 @@ const translation = {
|
|
|
999
1017
|
deleting: 'Deleting...',
|
|
1000
1018
|
type_delete_label: 'Type to confirm',
|
|
1001
1019
|
},
|
|
1020
|
+
session_management: {
|
|
1021
|
+
title: 'Security Settings',
|
|
1022
|
+
session_management_button: 'Session Management',
|
|
1023
|
+
},
|
|
1002
1024
|
},
|
|
1003
1025
|
/**
|
|
1004
1026
|
* @description copy keys for global wallet view
|
|
@@ -1980,6 +2002,37 @@ const translation = {
|
|
|
1980
2002
|
using_hardware_wallet_toggle_label: 'Using Ledger with {{chainName}}',
|
|
1981
2003
|
button: 'Connect',
|
|
1982
2004
|
},
|
|
2005
|
+
/**
|
|
2006
|
+
* @description copy keys for session management view
|
|
2007
|
+
* @default
|
|
2008
|
+
* {
|
|
2009
|
+
aria: {
|
|
2010
|
+
back_button_label: 'Back',
|
|
2011
|
+
info_button_label: 'Info',
|
|
2012
|
+
},
|
|
2013
|
+
title: 'Session Management',
|
|
2014
|
+
empty_sessions_view: {
|
|
2015
|
+
title: 'No active sessions found',
|
|
2016
|
+
},
|
|
2017
|
+
}
|
|
2018
|
+
*/
|
|
2019
|
+
dyn_session_management: {
|
|
2020
|
+
aria: {
|
|
2021
|
+
back_button_label: 'Back',
|
|
2022
|
+
info_button_label: 'Info',
|
|
2023
|
+
},
|
|
2024
|
+
title: 'Session Management',
|
|
2025
|
+
empty_sessions_view: {
|
|
2026
|
+
title: 'No active sessions found',
|
|
2027
|
+
},
|
|
2028
|
+
info_view: {
|
|
2029
|
+
title: 'Connected App Sessions',
|
|
2030
|
+
description_bold: 'Easily manage which apps have access to your wallet. ',
|
|
2031
|
+
description_2: "Each session represents a connection you've made with a site or app.",
|
|
2032
|
+
description_3: 'You can revoke access anytime to stay in control of where and how your wallet is used.',
|
|
2033
|
+
continue_button: 'Continue',
|
|
2034
|
+
},
|
|
2035
|
+
},
|
|
1983
2036
|
/**
|
|
1984
2037
|
* @description copy keys for sign message flow views
|
|
1985
2038
|
* @default
|
|
@@ -86,6 +86,7 @@ export { ReactComponent as QuestionMarkIcon } from './question-mark.svg';
|
|
|
86
86
|
export { ReactComponent as SavePasswordHeroIcon } from './save-password-hero.svg';
|
|
87
87
|
export { ReactComponent as SecureActionIcon } from './secure-action.svg';
|
|
88
88
|
export { ReactComponent as SendIcon } from './send.svg';
|
|
89
|
+
export { ReactComponent as SessionIcon } from './session.svg';
|
|
89
90
|
export { ReactComponent as SettingsIconOutline } from './settings-outline.svg';
|
|
90
91
|
export { ReactComponent as SettingsIcon } from './settings.svg';
|
|
91
92
|
export { ReactComponent as ShieldIcon } from './shield.svg';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
var _path;
|
|
29
|
+
var _excluded = ["title", "titleId"];
|
|
30
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
31
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
32
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } } return t; }
|
|
33
|
+
var SvgSession = function SvgSession(_ref) {
|
|
34
|
+
var title = _ref.title,
|
|
35
|
+
titleId = _ref.titleId,
|
|
36
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
38
|
+
width: 24,
|
|
39
|
+
height: 24,
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
fill: "none",
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
"aria-labelledby": titleId
|
|
44
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
45
|
+
id: titleId
|
|
46
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
47
|
+
fillRule: "evenodd",
|
|
48
|
+
clipRule: "evenodd",
|
|
49
|
+
d: "M12 4a8 8 0 1 0 7.791 9.823l-.384.384a1 1 0 0 1-1.414-1.414l2-2a1 1 0 0 1 1.415 0l2 2a1 1 0 0 1-1.415 1.414l-.195-.195C20.867 18.57 16.834 22 12 22 6.477 22 2 17.523 2 12S6.477 2 12 2a9.996 9.996 0 0 1 8.616 4.92 1 1 0 0 1-1.723 1.018A7.996 7.996 0 0 0 12 4Zm0 2a1 1 0 0 1 1 1v4.465l2.555 1.703a1 1 0 0 1-1.11 1.664l-3-2A1 1 0 0 1 11 12V7a1 1 0 0 1 1-1Z",
|
|
50
|
+
fill: "#ABACB2"
|
|
51
|
+
})));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.ReactComponent = SvgSession;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
var _path;
|
|
5
|
+
var _excluded = ["title", "titleId"];
|
|
6
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) { o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } } return t; }
|
|
9
|
+
var SvgSession = function SvgSession(_ref) {
|
|
10
|
+
var title = _ref.title,
|
|
11
|
+
titleId = _ref.titleId,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
+
width: 24,
|
|
15
|
+
height: 24,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
"aria-labelledby": titleId
|
|
20
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
21
|
+
id: titleId
|
|
22
|
+
}, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
clipRule: "evenodd",
|
|
25
|
+
d: "M12 4a8 8 0 1 0 7.791 9.823l-.384.384a1 1 0 0 1-1.414-1.414l2-2a1 1 0 0 1 1.415 0l2 2a1 1 0 0 1-1.415 1.414l-.195-.195C20.867 18.57 16.834 22 12 22 6.477 22 2 17.523 2 12S6.477 2 12 2a9.996 9.996 0 0 1 8.616 4.92 1 1 0 0 1-1.723 1.018A7.996 7.996 0 0 0 12 4Zm0 2a1 1 0 0 1 1 1v4.465l2.555 1.703a1 1 0 0 1-1.11 1.664l-3-2A1 1 0 0 1 11 12V7a1 1 0 0 1 1-1Z",
|
|
26
|
+
fill: "#ABACB2"
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { SvgSession as ReactComponent };
|
|
@@ -4,19 +4,12 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var logger = require('../../../shared/logger.cjs');
|
|
8
7
|
var hasPendingRequirements = require('../../../shared/utils/functions/hasPendingRequirements/hasPendingRequirements.cjs');
|
|
9
8
|
var createStoreState = require('../../internalImplementation/utils/createStoreState/createStoreState.cjs');
|
|
10
9
|
var raiseUserProfileEvent = require('./raiseUserProfileEvent/raiseUserProfileEvent.cjs');
|
|
11
10
|
|
|
12
11
|
const { getUser, setUser: setUserRaw, useUser: useUserRaw, } = createStoreState.createStoreState('user');
|
|
13
12
|
const setUser = (user) => {
|
|
14
|
-
if (user) {
|
|
15
|
-
logger.logger.metaData.set('user', user);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
logger.logger.metaData.set('user', undefined);
|
|
19
|
-
}
|
|
20
13
|
const oldUser = getUser();
|
|
21
14
|
setUserRaw(user);
|
|
22
15
|
if (user && oldUser)
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
-
import { logger } from '../../../shared/logger.js';
|
|
4
3
|
import { hasPendingRequirements } from '../../../shared/utils/functions/hasPendingRequirements/hasPendingRequirements.js';
|
|
5
4
|
import { createStoreState } from '../../internalImplementation/utils/createStoreState/createStoreState.js';
|
|
6
5
|
import { raiseUserProfileEvent } from './raiseUserProfileEvent/raiseUserProfileEvent.js';
|
|
7
6
|
|
|
8
7
|
const { getUser, setUser: setUserRaw, useUser: useUserRaw, } = createStoreState('user');
|
|
9
8
|
const setUser = (user) => {
|
|
10
|
-
if (user) {
|
|
11
|
-
logger.metaData.set('user', user);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
logger.metaData.set('user', undefined);
|
|
15
|
-
}
|
|
16
9
|
const oldUser = getUser();
|
|
17
10
|
setUserRaw(user);
|
|
18
11
|
if (user && oldUser)
|