cozy-pouch-link 53.1.0 → 53.1.1

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.
@@ -41,8 +41,6 @@ var _mapValues = _interopRequireDefault(require("lodash/mapValues"));
41
41
 
42
42
  var _zipWith = _interopRequireDefault(require("lodash/zipWith"));
43
43
 
44
- var _get = _interopRequireDefault(require("lodash/get"));
45
-
46
44
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
47
45
 
48
46
  var _helpers = _interopRequireDefault(require("./helpers"));
@@ -358,9 +356,12 @@ var PouchLink = /*#__PURE__*/function (_CozyLink) {
358
356
  key: "onLogin",
359
357
  value: function () {
360
358
  var _onLogin = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
361
- var _this2 = this;
359
+ var _this$options,
360
+ _this$options$pouch,
361
+ _this$options$pouch$o,
362
+ _this2 = this;
362
363
 
363
- var markName, prefix, shouldDestroyDatabases, adapter;
364
+ var markName, prefix, shouldDestroyDatabases, adapterName;
364
365
  return _regenerator.default.wrap(function _callee3$(_context3) {
365
366
  while (1) {
366
367
  switch (_context3.prev = _context3.next) {
@@ -415,20 +416,26 @@ var PouchLink = /*#__PURE__*/function (_CozyLink) {
415
416
  _logger.default.log('Create pouches with ' + prefix + ' prefix');
416
417
  }
417
418
 
418
- _context3.next = 21;
419
+ adapterName = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : (_this$options$pouch = _this$options.pouch) === null || _this$options$pouch === void 0 ? void 0 : (_this$options$pouch$o = _this$options$pouch.options) === null || _this$options$pouch$o === void 0 ? void 0 : _this$options$pouch$o.adapter;
420
+
421
+ if (!adapterName) {
422
+ _context3.next = 26;
423
+ break;
424
+ }
425
+
426
+ _context3.next = 23;
419
427
  return this.storage.getAdapterName();
420
428
 
421
- case 21:
429
+ case 23:
422
430
  if (_context3.sent) {
423
- _context3.next = 25;
431
+ _context3.next = 26;
424
432
  break;
425
433
  }
426
434
 
427
- adapter = (0, _get.default)(this.options, 'pouch.options.adapter');
428
- _context3.next = 25;
429
- return this.storage.persistAdapterName(adapter);
435
+ _context3.next = 26;
436
+ return this.storage.persistAdapterName(adapterName);
430
437
 
431
- case 25:
438
+ case 26:
432
439
  this.pouches = new _PouchManager.default(this.doctypes, {
433
440
  pouch: this.options.pouch,
434
441
  getReplicationURL: this.getReplicationURL.bind(this),
@@ -443,10 +450,10 @@ var PouchLink = /*#__PURE__*/function (_CozyLink) {
443
450
  executeQuery: this.executeQuery.bind(this),
444
451
  platform: this.options.platform
445
452
  });
446
- _context3.next = 28;
453
+ _context3.next = 29;
447
454
  return this.pouches.init();
448
455
 
449
- case 28:
456
+ case 29:
450
457
  if (this.client && this.initialSync) {
451
458
  this.startReplication();
452
459
  }
@@ -456,7 +463,7 @@ var PouchLink = /*#__PURE__*/function (_CozyLink) {
456
463
  category: 'CozyPouchLink'
457
464
  });
458
465
 
459
- case 30:
466
+ case 31:
460
467
  case "end":
461
468
  return _context3.stop();
462
469
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-pouch-link",
3
- "version": "53.1.0",
3
+ "version": "53.1.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "url": "git+https://github.com/cozy/cozy-client.git"
14
14
  },
15
15
  "dependencies": {
16
- "cozy-client": "^53.1.0",
16
+ "cozy-client": "^53.1.1",
17
17
  "pouchdb-browser": "^7.2.2",
18
18
  "pouchdb-find": "^7.2.2"
19
19
  },
@@ -39,5 +39,5 @@
39
39
  "typecheck": "tsc -p tsconfig.json"
40
40
  },
41
41
  "sideEffects": false,
42
- "gitHead": "d265f54c73e6e14860b83cffc79aa9a612119ca0"
42
+ "gitHead": "e74421c0e8a11c5d728a670a1f65b129a0e669d9"
43
43
  }