@etsoo/appscript 1.1.96 → 1.2.0

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.
@@ -21,7 +21,6 @@ class CoreApp {
21
21
  * @param name Application name
22
22
  */
23
23
  constructor(settings, api, notifier, storage, name) {
24
- var _a;
25
24
  this._authorized = false;
26
25
  this._isTryingLogin = false;
27
26
  /**
@@ -46,7 +45,7 @@ class CoreApp {
46
45
  this.storage = storage;
47
46
  this.name = name;
48
47
  // Device id
49
- this._deviceId = (_a = storage.getData(CoreApp.deviceIdField)) !== null && _a !== void 0 ? _a : '';
48
+ this._deviceId = storage.getData(CoreApp.deviceIdField, '');
50
49
  this.setApi(api);
51
50
  const { currentCulture, currentRegion } = settings;
52
51
  this.changeCulture(currentCulture);
@@ -176,7 +175,7 @@ class CoreApp {
176
175
  const data = {
177
176
  timestamp,
178
177
  identifier,
179
- deviceId: this.deviceId ? this.deviceId : undefined
178
+ deviceId: this.deviceId.length > 0 ? this.deviceId : undefined
180
179
  };
181
180
  const result = await this.apiInitCall(data);
182
181
  if (result == null) {
@@ -228,7 +227,7 @@ class CoreApp {
228
227
  return;
229
228
  // Update device id and cache it
230
229
  this._deviceId = data.deviceId;
231
- this.storage.setData(CoreApp.deviceIdField, this.deviceId);
230
+ this.storage.setData(CoreApp.deviceIdField, this._deviceId);
232
231
  // Current passphrase
233
232
  this.passphrase = passphrase;
234
233
  this.storage.setData(CoreApp.devicePassphraseField, this.encrypt(passphrase, this.name));
@@ -18,7 +18,6 @@ export class CoreApp {
18
18
  * @param name Application name
19
19
  */
20
20
  constructor(settings, api, notifier, storage, name) {
21
- var _a;
22
21
  this._authorized = false;
23
22
  this._isTryingLogin = false;
24
23
  /**
@@ -43,7 +42,7 @@ export class CoreApp {
43
42
  this.storage = storage;
44
43
  this.name = name;
45
44
  // Device id
46
- this._deviceId = (_a = storage.getData(CoreApp.deviceIdField)) !== null && _a !== void 0 ? _a : '';
45
+ this._deviceId = storage.getData(CoreApp.deviceIdField, '');
47
46
  this.setApi(api);
48
47
  const { currentCulture, currentRegion } = settings;
49
48
  this.changeCulture(currentCulture);
@@ -173,7 +172,7 @@ export class CoreApp {
173
172
  const data = {
174
173
  timestamp,
175
174
  identifier,
176
- deviceId: this.deviceId ? this.deviceId : undefined
175
+ deviceId: this.deviceId.length > 0 ? this.deviceId : undefined
177
176
  };
178
177
  const result = await this.apiInitCall(data);
179
178
  if (result == null) {
@@ -225,7 +224,7 @@ export class CoreApp {
225
224
  return;
226
225
  // Update device id and cache it
227
226
  this._deviceId = data.deviceId;
228
- this.storage.setData(CoreApp.deviceIdField, this.deviceId);
227
+ this.storage.setData(CoreApp.deviceIdField, this._deviceId);
229
228
  // Current passphrase
230
229
  this.passphrase = passphrase;
231
230
  this.storage.setData(CoreApp.devicePassphraseField, this.encrypt(passphrase, this.name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.1.96",
3
+ "version": "1.2.0",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.0.95",
56
56
  "@etsoo/restclient": "^1.0.63",
57
- "@etsoo/shared": "^1.0.88",
57
+ "@etsoo/shared": "^1.0.91",
58
58
  "@types/crypto-js": "^4.0.2",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
@@ -617,7 +617,7 @@ export abstract class CoreApp<
617
617
  this.name = name;
618
618
 
619
619
  // Device id
620
- this._deviceId = storage.getData<string>(CoreApp.deviceIdField) ?? '';
620
+ this._deviceId = storage.getData(CoreApp.deviceIdField, '');
621
621
 
622
622
  this.setApi(api);
623
623
 
@@ -707,7 +707,7 @@ export abstract class CoreApp<
707
707
  const data: InitCallDto = {
708
708
  timestamp,
709
709
  identifier,
710
- deviceId: this.deviceId ? this.deviceId : undefined
710
+ deviceId: this.deviceId.length > 0 ? this.deviceId : undefined
711
711
  };
712
712
 
713
713
  const result = await this.apiInitCall(data);
@@ -768,7 +768,7 @@ export abstract class CoreApp<
768
768
 
769
769
  // Update device id and cache it
770
770
  this._deviceId = data.deviceId;
771
- this.storage.setData(CoreApp.deviceIdField, this.deviceId);
771
+ this.storage.setData(CoreApp.deviceIdField, this._deviceId);
772
772
 
773
773
  // Current passphrase
774
774
  this.passphrase = passphrase;