x25 5.1.2 → 5.1.5
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/Async/RouteLoading.js +19 -20
- package/Async/SimulatedException.js +6 -5
- package/package.json +1 -1
package/Async/RouteLoading.js
CHANGED
|
@@ -10,33 +10,31 @@ var _react2 = _interopRequireDefault(_react);
|
|
|
10
10
|
|
|
11
11
|
var _Loading = require("../Messages/Loading");
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _Error = require("../Messages/Error");
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var _index = require("./index");
|
|
15
|
+
var _Error2 = _interopRequireDefault(_Error);
|
|
18
16
|
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
18
|
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
var RouteLoading = function RouteLoading(_ref) {
|
|
20
|
+
var theError = _ref.error,
|
|
21
|
+
retry = _ref.retry,
|
|
22
|
+
timedOut = _ref.timedOut;
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
};
|
|
24
|
+
if (theError) {
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.log("theError");
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.log(theError.name);
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.log(theError);
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
33
|
+
if (theError.name === "ChunkLoadError") {
|
|
34
|
+
return _react2.default.createElement(_Error2.default, { message: "Pagina nu a putut fi \xEEnc\u0103rcat\u0103. V\u0103 rug\u0103m s\u0103 face\u021Bi refresh la pagin\u0103" });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return null;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
if (timedOut) {
|
|
@@ -60,5 +58,6 @@ var RouteLoading = function RouteLoading(_ref2) {
|
|
|
60
58
|
_react2.default.createElement(_Loading.LoadingMessage, { message: "A\u0219teapt\u0103 un pic..." })
|
|
61
59
|
);
|
|
62
60
|
};
|
|
61
|
+
// import SimulatedException from "./SimulatedException";
|
|
63
62
|
|
|
64
63
|
exports.default = RouteLoading;
|
|
@@ -12,17 +12,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable max-classes-per-file */
|
|
14
14
|
|
|
15
|
+
// eslint-disable-next-line no-unused-vars
|
|
15
16
|
var CustomError = function (_Error) {
|
|
16
17
|
_inherits(CustomError, _Error);
|
|
17
18
|
|
|
18
|
-
function CustomError(
|
|
19
|
+
function CustomError(error) {
|
|
19
20
|
_classCallCheck(this, CustomError);
|
|
20
21
|
|
|
21
|
-
var _this = _possibleConstructorReturn(this, (CustomError.__proto__ || Object.getPrototypeOf(CustomError)).call(this,
|
|
22
|
+
var _this = _possibleConstructorReturn(this, (CustomError.__proto__ || Object.getPrototypeOf(CustomError)).call(this, error));
|
|
22
23
|
|
|
23
|
-
_this.message = message;
|
|
24
|
-
_this.name =
|
|
25
|
-
_this.stack = stack;
|
|
24
|
+
_this.message = error.message;
|
|
25
|
+
_this.name = error.name;
|
|
26
|
+
_this.stack = error.stack;
|
|
26
27
|
return _this;
|
|
27
28
|
}
|
|
28
29
|
|
package/package.json
CHANGED