kui-utils 0.0.29 → 0.0.31

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/cjs/index.js CHANGED
@@ -87,12 +87,13 @@ var useTabIndex = function (paths) {
87
87
 
88
88
  var useWindowWidth = function (time) {
89
89
  if (time === void 0) { time = 10; }
90
- var _a = React.useState(typeof window === "undefined" ? 0 : (window === null || window === void 0 ? void 0 : window.innerWidth) || 0), width = _a[0], setWidth = _a[1];
90
+ var _a = React.useState(0), width = _a[0], setWidth = _a[1];
91
91
  React.useEffect(function () {
92
92
  setWidth(window.innerWidth);
93
93
  var handleResize = ___default["default"].debounce(function () {
94
94
  setWidth(window.innerWidth);
95
95
  }, time);
96
+ handleResize();
96
97
  window.addEventListener("resize", handleResize);
97
98
  return function () { return window.removeEventListener("resize", handleResize); };
98
99
  }, []);
@@ -2221,7 +2222,9 @@ var Loader = /** @class */ (function () {
2221
2222
  return new Promise(function (resolve) {
2222
2223
  // eslint-disable-next-line no-promise-executor-return
2223
2224
  return setTimeout(function () {
2224
- _this.isLoading = false;
2225
+ mobx.runInAction(function () {
2226
+ _this.isLoading = false;
2227
+ });
2225
2228
  resolve(true);
2226
2229
  }, _this.delayTime - (_this.timeAfterLoading - _this.timeBeforeLoading));
2227
2230
  });