@etsoo/appscript 1.5.38 → 1.5.40

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.
@@ -129,7 +129,6 @@ class CoreApp {
129
129
  this.pendings = [];
130
130
  this._authorized = false;
131
131
  this._isReady = false;
132
- this._embedded = false;
133
132
  this._isTryingLogin = false;
134
133
  /**
135
134
  * Last called with token refresh
@@ -186,6 +185,9 @@ class CoreApp {
186
185
  this.fields = IApp_1.appFields.reduce((a, v) => ({ ...a, [v]: 'smarterp-' + v + '-' + name }), {});
187
186
  // Device id
188
187
  this._deviceId = storage.getData(this.fields.deviceId, '');
188
+ // Embedded
189
+ this._embedded =
190
+ this.storage.getData(this.fields.embedded) ?? false;
189
191
  const { currentCulture, currentRegion } = settings;
190
192
  // Load resources
191
193
  Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
@@ -14,16 +14,14 @@ var CultureUtils;
14
14
  */
15
15
  function make(...resources) {
16
16
  return shared_1.DomUtils.zhHans(async () => {
17
- const rs = await Promise.all([
18
- ...resources.map((resource) => new Promise((resolve) => {
19
- if (typeof resource === 'object') {
20
- resolve(resource);
21
- }
22
- else {
23
- resource().then((result) => resolve(result));
24
- }
25
- }))
26
- ]);
17
+ const rs = await Promise.all(resources.map((resource) => new Promise((resolve) => {
18
+ if (typeof resource === 'object') {
19
+ resolve(resource);
20
+ }
21
+ else {
22
+ resource().then((result) => resolve(result));
23
+ }
24
+ })));
27
25
  return rs.reduce((prev, curr) => ({
28
26
  ...prev,
29
27
  ...curr
@@ -183,7 +183,7 @@
183
183
  "serviceDisabled": "The service is not enabled or has been disabled",
184
184
  "showIt": "Show it",
185
185
  "signout": "Sign out",
186
- "smartERP": "SmartERP",
186
+ "smartERP": "SmartERP Cloud",
187
187
  "sortTip": "Drag and drop items to sort",
188
188
  "state": "Province/State",
189
189
  "status": "Status",
@@ -126,7 +126,6 @@ export class CoreApp {
126
126
  this.pendings = [];
127
127
  this._authorized = false;
128
128
  this._isReady = false;
129
- this._embedded = false;
130
129
  this._isTryingLogin = false;
131
130
  /**
132
131
  * Last called with token refresh
@@ -183,6 +182,9 @@ export class CoreApp {
183
182
  this.fields = appFields.reduce((a, v) => ({ ...a, [v]: 'smarterp-' + v + '-' + name }), {});
184
183
  // Device id
185
184
  this._deviceId = storage.getData(this.fields.deviceId, '');
185
+ // Embedded
186
+ this._embedded =
187
+ this.storage.getData(this.fields.embedded) ?? false;
186
188
  const { currentCulture, currentRegion } = settings;
187
189
  // Load resources
188
190
  Promise.all([loadCrypto(), this.changeCulture(currentCulture)]).then(([cj, _resources]) => {
@@ -11,16 +11,14 @@ export var CultureUtils;
11
11
  */
12
12
  function make(...resources) {
13
13
  return DomUtils.zhHans(async () => {
14
- const rs = await Promise.all([
15
- ...resources.map((resource) => new Promise((resolve) => {
16
- if (typeof resource === 'object') {
17
- resolve(resource);
18
- }
19
- else {
20
- resource().then((result) => resolve(result));
21
- }
22
- }))
23
- ]);
14
+ const rs = await Promise.all(resources.map((resource) => new Promise((resolve) => {
15
+ if (typeof resource === 'object') {
16
+ resolve(resource);
17
+ }
18
+ else {
19
+ resource().then((result) => resolve(result));
20
+ }
21
+ })));
24
22
  return rs.reduce((prev, curr) => ({
25
23
  ...prev,
26
24
  ...curr
@@ -183,7 +183,7 @@
183
183
  "serviceDisabled": "The service is not enabled or has been disabled",
184
184
  "showIt": "Show it",
185
185
  "signout": "Sign out",
186
- "smartERP": "SmartERP",
186
+ "smartERP": "SmartERP Cloud",
187
187
  "sortTip": "Drag and drop items to sort",
188
188
  "state": "Province/State",
189
189
  "status": "Status",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.38",
3
+ "version": "1.5.40",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -248,7 +248,7 @@ export abstract class CoreApp<
248
248
  this.storage.setData(this.fields.cachedUrl, value);
249
249
  }
250
250
 
251
- private _embedded: boolean = false;
251
+ private _embedded: boolean;
252
252
  /**
253
253
  * Is embedded
254
254
  */
@@ -361,6 +361,10 @@ export abstract class CoreApp<
361
361
  // Device id
362
362
  this._deviceId = storage.getData(this.fields.deviceId, '');
363
363
 
364
+ // Embedded
365
+ this._embedded =
366
+ this.storage.getData<boolean>(this.fields.embedded) ?? false;
367
+
364
368
  const { currentCulture, currentRegion } = settings;
365
369
 
366
370
  // Load resources
@@ -11,8 +11,8 @@ export namespace CultureUtils {
11
11
  */
12
12
  export function make(...resources: (object | (() => Promise<object>))[]) {
13
13
  return DomUtils.zhHans(async () => {
14
- const rs = await Promise.all([
15
- ...resources.map(
14
+ const rs = await Promise.all(
15
+ resources.map(
16
16
  (resource) =>
17
17
  new Promise<object>((resolve) => {
18
18
  if (typeof resource === 'object') {
@@ -22,7 +22,7 @@ export namespace CultureUtils {
22
22
  }
23
23
  })
24
24
  )
25
- ]);
25
+ );
26
26
  return rs.reduce((prev, curr) => ({
27
27
  ...prev,
28
28
  ...curr
package/src/i18n/en.json CHANGED
@@ -183,7 +183,7 @@
183
183
  "serviceDisabled": "The service is not enabled or has been disabled",
184
184
  "showIt": "Show it",
185
185
  "signout": "Sign out",
186
- "smartERP": "SmartERP",
186
+ "smartERP": "SmartERP Cloud",
187
187
  "sortTip": "Drag and drop items to sort",
188
188
  "state": "Province/State",
189
189
  "status": "Status",