@stokr/components-library 2.0.6 → 2.0.7
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.
- package/dist/context/AuthContext.js +23 -6
- package/dist/index.js +22 -0
- package/package.json +1 -1
|
@@ -564,7 +564,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
564
564
|
});
|
|
565
565
|
_defineProperty(_assertThisInitialized(_this), "updateUser", /*#__PURE__*/function () {
|
|
566
566
|
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(data) {
|
|
567
|
-
var _yield$Auth$updateUse, user;
|
|
567
|
+
var _yield$Auth$updateUse, user, firebaseUser, _yield$fetchData2, customToken, newUser;
|
|
568
568
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
569
569
|
while (1) switch (_context11.prev = _context11.next) {
|
|
570
570
|
case 0:
|
|
@@ -574,18 +574,35 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
574
574
|
case 3:
|
|
575
575
|
_yield$Auth$updateUse = _context11.sent;
|
|
576
576
|
user = _yield$Auth$updateUse.user;
|
|
577
|
-
_this.
|
|
578
|
-
|
|
577
|
+
firebaseUser = _this.state.firebaseUser;
|
|
578
|
+
if (firebaseUser) {
|
|
579
|
+
_context11.next = 14;
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
_context11.next = 9;
|
|
583
|
+
return (0, _fetchData.default)('auth/get-custom-token');
|
|
579
584
|
case 9:
|
|
580
|
-
|
|
585
|
+
_yield$fetchData2 = _context11.sent;
|
|
586
|
+
customToken = _yield$fetchData2.customToken;
|
|
587
|
+
_context11.next = 13;
|
|
588
|
+
return _Auth.default.signInWithToken(customToken);
|
|
589
|
+
case 13:
|
|
590
|
+
firebaseUser = _context11.sent;
|
|
591
|
+
case 14:
|
|
592
|
+
//merge firebaseUser and our user object
|
|
593
|
+
newUser = _this.patchUserObject(user, firebaseUser);
|
|
594
|
+
_this.setUser(newUser);
|
|
595
|
+
return _context11.abrupt("return", user);
|
|
596
|
+
case 19:
|
|
597
|
+
_context11.prev = 19;
|
|
581
598
|
_context11.t0 = _context11["catch"](0);
|
|
582
599
|
console.log("Error updating the user: ".concat(_context11.t0));
|
|
583
600
|
throw _context11.t0;
|
|
584
|
-
case
|
|
601
|
+
case 23:
|
|
585
602
|
case "end":
|
|
586
603
|
return _context11.stop();
|
|
587
604
|
}
|
|
588
|
-
}, _callee11, null, [[0,
|
|
605
|
+
}, _callee11, null, [[0, 19]]);
|
|
589
606
|
}));
|
|
590
607
|
return function (_x15) {
|
|
591
608
|
return _ref11.apply(this, arguments);
|
package/dist/index.js
CHANGED
|
@@ -278,6 +278,17 @@ Object.keys(_Form).forEach(function (key) {
|
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
|
+
var _Card = require("./components/Card/Card.styles");
|
|
282
|
+
Object.keys(_Card).forEach(function (key) {
|
|
283
|
+
if (key === "default" || key === "__esModule") return;
|
|
284
|
+
if (key in exports && exports[key] === _Card[key]) return;
|
|
285
|
+
Object.defineProperty(exports, key, {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function get() {
|
|
288
|
+
return _Card[key];
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
281
292
|
var _Grid = require("./components/Grid/Grid.styles");
|
|
282
293
|
Object.keys(_Grid).forEach(function (key) {
|
|
283
294
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -399,6 +410,17 @@ Object.keys(_InputUsername).forEach(function (key) {
|
|
|
399
410
|
}
|
|
400
411
|
});
|
|
401
412
|
});
|
|
413
|
+
var _InputWithButton = require("./components/Input/InputWithButton");
|
|
414
|
+
Object.keys(_InputWithButton).forEach(function (key) {
|
|
415
|
+
if (key === "default" || key === "__esModule") return;
|
|
416
|
+
if (key in exports && exports[key] === _InputWithButton[key]) return;
|
|
417
|
+
Object.defineProperty(exports, key, {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
get: function get() {
|
|
420
|
+
return _InputWithButton[key];
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
});
|
|
402
424
|
var _InvestCalculator = require("./components/InvestCalculator/InvestCalculator");
|
|
403
425
|
Object.keys(_InvestCalculator).forEach(function (key) {
|
|
404
426
|
if (key === "default" || key === "__esModule") return;
|