@etsoo/react 1.3.66 → 1.3.67
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/ReactApp.d.ts +2 -1
- package/lib/app/ReactApp.js +3 -2
- package/package.json +1 -1
- package/src/app/ReactApp.ts +4 -2
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -144,8 +144,9 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
144
144
|
* @param user New user
|
|
145
145
|
* @param refreshToken Refresh token
|
|
146
146
|
* @param keep Keep in local storage or not
|
|
147
|
+
* @param dispatch User state dispatch
|
|
147
148
|
*/
|
|
148
|
-
userLogin(user: IUserData, refreshToken: string, keep?: boolean): void;
|
|
149
|
+
userLogin(user: IUserData, refreshToken: string, keep?: boolean, dispatch?: boolean): void;
|
|
149
150
|
/**
|
|
150
151
|
* User logout
|
|
151
152
|
* @param clearToken Clear refresh token or not
|
package/lib/app/ReactApp.js
CHANGED
|
@@ -210,12 +210,13 @@ export class ReactApp extends CoreApp {
|
|
|
210
210
|
* @param user New user
|
|
211
211
|
* @param refreshToken Refresh token
|
|
212
212
|
* @param keep Keep in local storage or not
|
|
213
|
+
* @param dispatch User state dispatch
|
|
213
214
|
*/
|
|
214
|
-
userLogin(user, refreshToken, keep) {
|
|
215
|
+
userLogin(user, refreshToken, keep, dispatch) {
|
|
215
216
|
// Super call, set token
|
|
216
217
|
super.userLogin(user, refreshToken, keep);
|
|
217
218
|
// Dispatch action
|
|
218
|
-
if (this.userStateDispatch != null)
|
|
219
|
+
if (this.userStateDispatch != null && dispatch !== false)
|
|
219
220
|
this.userStateDispatch({
|
|
220
221
|
type: UserActionType.Login,
|
|
221
222
|
user
|
package/package.json
CHANGED
package/src/app/ReactApp.ts
CHANGED
|
@@ -353,17 +353,19 @@ export class ReactApp<
|
|
|
353
353
|
* @param user New user
|
|
354
354
|
* @param refreshToken Refresh token
|
|
355
355
|
* @param keep Keep in local storage or not
|
|
356
|
+
* @param dispatch User state dispatch
|
|
356
357
|
*/
|
|
357
358
|
override userLogin(
|
|
358
359
|
user: IUserData,
|
|
359
360
|
refreshToken: string,
|
|
360
|
-
keep?: boolean
|
|
361
|
+
keep?: boolean,
|
|
362
|
+
dispatch?: boolean
|
|
361
363
|
): void {
|
|
362
364
|
// Super call, set token
|
|
363
365
|
super.userLogin(user, refreshToken, keep);
|
|
364
366
|
|
|
365
367
|
// Dispatch action
|
|
366
|
-
if (this.userStateDispatch != null)
|
|
368
|
+
if (this.userStateDispatch != null && dispatch !== false)
|
|
367
369
|
this.userStateDispatch({
|
|
368
370
|
type: UserActionType.Login,
|
|
369
371
|
user
|