@frontegg/redux-store 7.99.0 → 7.100.0-alpha.1
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/auth/ProfileState/actions.js +8 -7
- package/index.js +1 -1
- package/node/auth/ProfileState/actions.js +8 -7
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -16,9 +16,10 @@ export default ((store, api, sharedActions) => {
|
|
|
16
16
|
loading: true
|
|
17
17
|
});
|
|
18
18
|
try {
|
|
19
|
-
const profile = await retry(api.
|
|
19
|
+
const profile = await retry(api.auth.getMeAndEntitlements, 3, 2000);
|
|
20
20
|
const currentUser = store.auth.user;
|
|
21
|
-
|
|
21
|
+
const mergedUser = _extends({}, currentUser, profile);
|
|
22
|
+
actions.setUser(mergedUser);
|
|
22
23
|
setProfileState({
|
|
23
24
|
profile,
|
|
24
25
|
loading: false
|
|
@@ -117,13 +118,13 @@ export default ((store, api, sharedActions) => {
|
|
|
117
118
|
const newProfileData = _extends({}, oldProfileData, payload, {
|
|
118
119
|
profilePictureUrl: newProfilePictureUrl
|
|
119
120
|
});
|
|
120
|
-
|
|
121
|
-
//TODO: change the payload type to IUpdateUserProfile which is the right type to send, currently we send more data then actually needed.
|
|
122
|
-
const profile = await api.users.updateUserProfileV2(newProfileData);
|
|
121
|
+
await api.users.updateUserProfileV2(newProfileData);
|
|
123
122
|
const currentUser = store.auth.user;
|
|
124
|
-
|
|
123
|
+
const completeUserData = await retry(api.auth.getMeAndEntitlements, 3, 2000);
|
|
124
|
+
const mergedUser = _extends({}, currentUser, completeUserData);
|
|
125
|
+
actions.setUser(mergedUser);
|
|
125
126
|
actions.setProfileState({
|
|
126
|
-
profile,
|
|
127
|
+
profile: completeUserData,
|
|
127
128
|
saving: false,
|
|
128
129
|
loading: false
|
|
129
130
|
});
|
package/index.js
CHANGED
|
@@ -23,9 +23,10 @@ var _default = (store, api, sharedActions) => {
|
|
|
23
23
|
loading: true
|
|
24
24
|
});
|
|
25
25
|
try {
|
|
26
|
-
const profile = await (0, _helpers.retry)(api.
|
|
26
|
+
const profile = await (0, _helpers.retry)(api.auth.getMeAndEntitlements, 3, 2000);
|
|
27
27
|
const currentUser = store.auth.user;
|
|
28
|
-
|
|
28
|
+
const mergedUser = (0, _extends2.default)({}, currentUser, profile);
|
|
29
|
+
actions.setUser(mergedUser);
|
|
29
30
|
setProfileState({
|
|
30
31
|
profile,
|
|
31
32
|
loading: false
|
|
@@ -124,13 +125,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
124
125
|
const newProfileData = (0, _extends2.default)({}, oldProfileData, payload, {
|
|
125
126
|
profilePictureUrl: newProfilePictureUrl
|
|
126
127
|
});
|
|
127
|
-
|
|
128
|
-
//TODO: change the payload type to IUpdateUserProfile which is the right type to send, currently we send more data then actually needed.
|
|
129
|
-
const profile = await api.users.updateUserProfileV2(newProfileData);
|
|
128
|
+
await api.users.updateUserProfileV2(newProfileData);
|
|
130
129
|
const currentUser = store.auth.user;
|
|
131
|
-
|
|
130
|
+
const completeUserData = await (0, _helpers.retry)(api.auth.getMeAndEntitlements, 3, 2000);
|
|
131
|
+
const mergedUser = (0, _extends2.default)({}, currentUser, completeUserData);
|
|
132
|
+
actions.setUser(mergedUser);
|
|
132
133
|
actions.setProfileState({
|
|
133
|
-
profile,
|
|
134
|
+
profile: completeUserData,
|
|
134
135
|
saving: false,
|
|
135
136
|
loading: false
|
|
136
137
|
});
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.100.0-alpha.1",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.
|
|
10
|
+
"@frontegg/rest-api": "7.100.0-alpha.1",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|