@memberstack/dom 1.0.0-beta.14 → 1.0.0-beta.15
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/lib/utils/proxy.js +10 -15
- package/package.json +1 -1
package/lib/utils/proxy.js
CHANGED
|
@@ -59,25 +59,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
var persistence_1 = require("../auth/persistence");
|
|
60
60
|
var handleResponse = function (fn, props) {
|
|
61
61
|
return function () {
|
|
62
|
-
var _a;
|
|
63
62
|
var args = [];
|
|
64
63
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
65
64
|
args[_i] = arguments[_i];
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return res;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return fun;
|
|
66
|
+
return Promise.resolve(fn.apply(void 0, __spread(args))).then(function (res) {
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.member) {
|
|
69
|
+
persistence_1.setPersistedMember((_b = res.data) === null || _b === void 0 ? void 0 : _b.member, props.persistence);
|
|
70
|
+
}
|
|
71
|
+
if ((_d = (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.startsWith("mem_")) {
|
|
72
|
+
persistence_1.setPersistedMember(res.data, props.persistence);
|
|
73
|
+
}
|
|
74
|
+
return res;
|
|
75
|
+
});
|
|
81
76
|
};
|
|
82
77
|
};
|
|
83
78
|
var handler = function (props) { return ({
|