@etsoo/materialui 1.4.54 → 1.4.56
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/lib/app/ServiceApp.js +3 -2
- package/package.json +3 -3
- package/src/app/ServiceApp.ts +4 -5
package/lib/app/ServiceApp.js
CHANGED
|
@@ -134,7 +134,6 @@ export class ServiceApp extends ReactApp {
|
|
|
134
134
|
userLoginEx(user, core, dispatch) {
|
|
135
135
|
// User login
|
|
136
136
|
const { refreshToken } = user;
|
|
137
|
-
this.userLogin(user, refreshToken, dispatch);
|
|
138
137
|
// Core system login
|
|
139
138
|
core ??= {
|
|
140
139
|
refreshToken,
|
|
@@ -144,6 +143,8 @@ export class ServiceApp extends ReactApp {
|
|
|
144
143
|
};
|
|
145
144
|
// Cache the core system data
|
|
146
145
|
this.saveCoreToken(core);
|
|
146
|
+
// User login and trigger the dispatch at last
|
|
147
|
+
this.userLogin(user, refreshToken, dispatch);
|
|
147
148
|
}
|
|
148
149
|
/**
|
|
149
150
|
* Save core system data
|
|
@@ -167,7 +168,7 @@ export class ServiceApp extends ReactApp {
|
|
|
167
168
|
if (!this.coreAccessToken) {
|
|
168
169
|
throw new Error("Core access token is required to switch organization.");
|
|
169
170
|
}
|
|
170
|
-
const [result, refreshToken] = await new AuthApi(this
|
|
171
|
+
const [result, refreshToken] = await new AuthApi(this).switchOrg({ organizationId, fromOrganizationId, token: this.coreAccessToken }, payload);
|
|
171
172
|
if (result == null)
|
|
172
173
|
return;
|
|
173
174
|
if (!result.ok) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.56",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@etsoo/notificationbase": "^1.1.54",
|
|
40
40
|
"@etsoo/react": "^1.8.15",
|
|
41
41
|
"@etsoo/shared": "^1.2.55",
|
|
42
|
-
"@mui/icons-material": "^6.3.
|
|
43
|
-
"@mui/material": "^6.3.
|
|
42
|
+
"@mui/icons-material": "^6.3.1",
|
|
43
|
+
"@mui/material": "^6.3.1",
|
|
44
44
|
"@mui/x-data-grid": "^7.23.5",
|
|
45
45
|
"chart.js": "^4.4.7",
|
|
46
46
|
"chartjs-plugin-datalabels": "^2.2.0",
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -176,7 +176,6 @@ export class ServiceApp<
|
|
|
176
176
|
) {
|
|
177
177
|
// User login
|
|
178
178
|
const { refreshToken } = user;
|
|
179
|
-
this.userLogin(user, refreshToken, dispatch);
|
|
180
179
|
|
|
181
180
|
// Core system login
|
|
182
181
|
core ??= {
|
|
@@ -188,6 +187,9 @@ export class ServiceApp<
|
|
|
188
187
|
|
|
189
188
|
// Cache the core system data
|
|
190
189
|
this.saveCoreToken(core);
|
|
190
|
+
|
|
191
|
+
// User login and trigger the dispatch at last
|
|
192
|
+
this.userLogin(user, refreshToken, dispatch);
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
/**
|
|
@@ -220,10 +222,7 @@ export class ServiceApp<
|
|
|
220
222
|
throw new Error("Core access token is required to switch organization.");
|
|
221
223
|
}
|
|
222
224
|
|
|
223
|
-
const [result, refreshToken] = await new AuthApi(
|
|
224
|
-
this,
|
|
225
|
-
this.coreApi
|
|
226
|
-
).switchOrg(
|
|
225
|
+
const [result, refreshToken] = await new AuthApi(this).switchOrg(
|
|
227
226
|
{ organizationId, fromOrganizationId, token: this.coreAccessToken },
|
|
228
227
|
payload
|
|
229
228
|
);
|