@etsoo/react 1.3.77 → 1.3.81
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.js +13 -2
- package/lib/app/ServiceApp.js +1 -1
- package/package.json +3 -3
- package/src/app/ReactApp.ts +39 -7
- package/src/app/ServiceApp.ts +1 -1
package/lib/app/ReactApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CoreApp, createClient } from '@etsoo/appscript';
|
|
2
|
-
import { WindowStorage } from '@etsoo/shared';
|
|
2
|
+
import { DomUtils, StorageUtils, WindowStorage } from '@etsoo/shared';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { NotifierMU } from '../mu/NotifierMU';
|
|
5
5
|
import { ProgressCount } from '../mu/ProgressCount';
|
|
@@ -59,10 +59,21 @@ export class ReactApp extends CoreApp {
|
|
|
59
59
|
constructor(settings, name, globalFields) {
|
|
60
60
|
super(settings, ReactApp.createApi(settings), ReactApp.createNotifier(), new WindowStorage([
|
|
61
61
|
...globalFields,
|
|
62
|
+
DomUtils.CountryField,
|
|
63
|
+
DomUtils.CultureField,
|
|
62
64
|
CoreApp.deviceIdField,
|
|
63
65
|
CoreApp.headerTokenField,
|
|
64
66
|
CoreApp.serversideDeviceIdField
|
|
65
|
-
]
|
|
67
|
+
], (field, data, index) => {
|
|
68
|
+
if (index > 0 && field === CoreApp.headerTokenField) {
|
|
69
|
+
// Clear passphrase to regenerate the device id
|
|
70
|
+
StorageUtils.setSessionData(CoreApp.devicePassphraseField, undefined);
|
|
71
|
+
console.log('devicePassphraseField', index, StorageUtils.getSessionData(CoreApp.devicePassphraseField));
|
|
72
|
+
// Clear token
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return data;
|
|
76
|
+
}), name);
|
|
66
77
|
/**
|
|
67
78
|
* User state
|
|
68
79
|
*/
|
package/lib/app/ServiceApp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.81",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"@emotion/style": "^0.8.0",
|
|
52
52
|
"@emotion/styled": "^11.6.0",
|
|
53
|
-
"@etsoo/appscript": "^1.1.
|
|
53
|
+
"@etsoo/appscript": "^1.1.97",
|
|
54
54
|
"@etsoo/notificationbase": "^1.0.95",
|
|
55
|
-
"@etsoo/shared": "^1.0.
|
|
55
|
+
"@etsoo/shared": "^1.0.89",
|
|
56
56
|
"@mui/icons-material": "^5.2.5",
|
|
57
57
|
"@mui/material": "^5.2.5",
|
|
58
58
|
"@reach/router": "^1.3.4",
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -7,7 +7,12 @@ import {
|
|
|
7
7
|
IUserData
|
|
8
8
|
} from '@etsoo/appscript';
|
|
9
9
|
import { NotificationRenderProps } from '@etsoo/notificationbase';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
DataTypes,
|
|
12
|
+
DomUtils,
|
|
13
|
+
StorageUtils,
|
|
14
|
+
WindowStorage
|
|
15
|
+
} from '@etsoo/shared';
|
|
11
16
|
import React from 'react';
|
|
12
17
|
import { NotifierMU } from '../mu/NotifierMU';
|
|
13
18
|
import { ProgressCount } from '../mu/ProgressCount';
|
|
@@ -189,12 +194,39 @@ export class ReactApp<
|
|
|
189
194
|
settings,
|
|
190
195
|
ReactApp.createApi(settings),
|
|
191
196
|
ReactApp.createNotifier(),
|
|
192
|
-
new WindowStorage(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
new WindowStorage(
|
|
198
|
+
[
|
|
199
|
+
...globalFields,
|
|
200
|
+
|
|
201
|
+
DomUtils.CountryField,
|
|
202
|
+
DomUtils.CultureField,
|
|
203
|
+
|
|
204
|
+
CoreApp.deviceIdField,
|
|
205
|
+
CoreApp.headerTokenField,
|
|
206
|
+
CoreApp.serversideDeviceIdField
|
|
207
|
+
],
|
|
208
|
+
(field, data, index) => {
|
|
209
|
+
if (index > 0 && field === CoreApp.headerTokenField) {
|
|
210
|
+
// Clear passphrase to regenerate the device id
|
|
211
|
+
StorageUtils.setSessionData(
|
|
212
|
+
CoreApp.devicePassphraseField,
|
|
213
|
+
undefined
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
console.log(
|
|
217
|
+
'devicePassphraseField',
|
|
218
|
+
index,
|
|
219
|
+
StorageUtils.getSessionData(
|
|
220
|
+
CoreApp.devicePassphraseField
|
|
221
|
+
)
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
// Clear token
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
return data;
|
|
228
|
+
}
|
|
229
|
+
),
|
|
198
230
|
name
|
|
199
231
|
);
|
|
200
232
|
this.cultureState = new CultureState(settings.currentCulture);
|