chayns-api 2.4.28 → 2.4.29

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.
@@ -572,6 +572,13 @@ class AppWrapper {
572
572
  key,
573
573
  accessMode
574
574
  });
575
+ if (['iOS', 'Mac OS'].includes(this.values.device.os) && typeof (result === null || result === void 0 ? void 0 : result.object) === 'string') {
576
+ try {
577
+ return JSON.parse(result.object);
578
+ } catch {
579
+ console.warn('[chayns-api] could not parse result from storageGetItem', result.object);
580
+ }
581
+ }
575
582
  return result === null || result === void 0 ? void 0 : result.object;
576
583
  },
577
584
  storageRemoveItem: async (key, accessMode) => {
@@ -583,9 +590,13 @@ class AppWrapper {
583
590
  });
584
591
  },
585
592
  storageSetItem: async (key, value, accessMode, tappIds) => {
593
+ let object = value;
594
+ if (['iOS', 'Mac OS'].includes(this.values.device.os)) {
595
+ object = JSON.stringify(value);
596
+ }
586
597
  this.appCall(73, {
587
598
  key,
588
- object: value,
599
+ object,
589
600
  accessMode,
590
601
  tappIDs: tappIds
591
602
  }, {
@@ -539,6 +539,13 @@ export class AppWrapper {
539
539
  key,
540
540
  accessMode
541
541
  });
542
+ if (['iOS', 'Mac OS'].includes(this.values.device.os) && typeof (result === null || result === void 0 ? void 0 : result.object) === 'string') {
543
+ try {
544
+ return JSON.parse(result.object);
545
+ } catch {
546
+ console.warn('[chayns-api] could not parse result from storageGetItem', result.object);
547
+ }
548
+ }
542
549
  return result === null || result === void 0 ? void 0 : result.object;
543
550
  },
544
551
  storageRemoveItem: async (key, accessMode) => {
@@ -550,9 +557,13 @@ export class AppWrapper {
550
557
  });
551
558
  },
552
559
  storageSetItem: async (key, value, accessMode, tappIds) => {
560
+ let object = value;
561
+ if (['iOS', 'Mac OS'].includes(this.values.device.os)) {
562
+ object = JSON.stringify(value);
563
+ }
553
564
  this.appCall(73, {
554
565
  key,
555
- object: value,
566
+ object,
556
567
  accessMode,
557
568
  tappIDs: tappIds
558
569
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "2.4.28",
3
+ "version": "2.4.29",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",