@etsoo/appscript 1.5.55 → 1.5.57

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.
@@ -44,6 +44,7 @@ class CoreApp {
44
44
  }
45
45
  set deviceId(value) {
46
46
  this._deviceId = value;
47
+ this.storage.setData(this.fields.deviceId, this._deviceId);
47
48
  }
48
49
  /**
49
50
  * Label delegate
@@ -641,8 +642,7 @@ class CoreApp {
641
642
  if (passphrase == null)
642
643
  return false;
643
644
  // Update device id and cache it
644
- this._deviceId = data.deviceId;
645
- this.storage.setData(this.fields.deviceId, this._deviceId);
645
+ this.deviceId = data.deviceId;
646
646
  // Devices
647
647
  const devices = this.storage.getPersistedData(this.fields.devices, []);
648
648
  devices.push(this.getDeviceId());
@@ -1527,7 +1527,7 @@ class CoreApp {
1527
1527
  */
1528
1528
  async apiRefreshTokenData(api, token) {
1529
1529
  // Call the API quietly, no loading bar and no error popup
1530
- return new AuthApi_1.AuthApi(this).apiRefreshToken({ token }, {
1530
+ return new AuthApi_1.AuthApi(this, api).apiRefreshToken({ token }, {
1531
1531
  showLoading: false,
1532
1532
  onError: (error) => {
1533
1533
  console.error(`CoreApp.${api.name}.apiRefreshToken error`, error);
@@ -41,6 +41,7 @@ export class CoreApp {
41
41
  }
42
42
  set deviceId(value) {
43
43
  this._deviceId = value;
44
+ this.storage.setData(this.fields.deviceId, this._deviceId);
44
45
  }
45
46
  /**
46
47
  * Label delegate
@@ -638,8 +639,7 @@ export class CoreApp {
638
639
  if (passphrase == null)
639
640
  return false;
640
641
  // Update device id and cache it
641
- this._deviceId = data.deviceId;
642
- this.storage.setData(this.fields.deviceId, this._deviceId);
642
+ this.deviceId = data.deviceId;
643
643
  // Devices
644
644
  const devices = this.storage.getPersistedData(this.fields.devices, []);
645
645
  devices.push(this.getDeviceId());
@@ -1524,7 +1524,7 @@ export class CoreApp {
1524
1524
  */
1525
1525
  async apiRefreshTokenData(api, token) {
1526
1526
  // Call the API quietly, no loading bar and no error popup
1527
- return new AuthApi(this).apiRefreshToken({ token }, {
1527
+ return new AuthApi(this, api).apiRefreshToken({ token }, {
1528
1528
  showLoading: false,
1529
1529
  onError: (error) => {
1530
1530
  console.error(`CoreApp.${api.name}.apiRefreshToken error`, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.5.55",
3
+ "version": "1.5.57",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -176,6 +176,7 @@ export abstract class CoreApp<
176
176
  }
177
177
  protected set deviceId(value: string) {
178
178
  this._deviceId = value;
179
+ this.storage.setData(this.fields.deviceId, this._deviceId);
179
180
  }
180
181
 
181
182
  /**
@@ -980,8 +981,7 @@ export abstract class CoreApp<
980
981
  if (passphrase == null) return false;
981
982
 
982
983
  // Update device id and cache it
983
- this._deviceId = data.deviceId;
984
- this.storage.setData(this.fields.deviceId, this._deviceId);
984
+ this.deviceId = data.deviceId;
985
985
 
986
986
  // Devices
987
987
  const devices = this.storage.getPersistedData<string[]>(
@@ -2093,7 +2093,7 @@ export abstract class CoreApp<
2093
2093
  token: string
2094
2094
  ): Promise<ApiRefreshTokenDto | undefined> {
2095
2095
  // Call the API quietly, no loading bar and no error popup
2096
- return new AuthApi(this).apiRefreshToken(
2096
+ return new AuthApi(this, api).apiRefreshToken(
2097
2097
  { token },
2098
2098
  {
2099
2099
  showLoading: false,