cx 24.11.3 → 24.11.4

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/widgets.js CHANGED
@@ -4936,7 +4936,7 @@ function createHotPromiseWindowFactoryWithProps(module, factory) {
4936
4936
  dismiss == null || dismiss();
4937
4937
  var window = Window.create(factory(props)(resolve, reject));
4938
4938
  window.overlayWillDismiss = function () {
4939
- if (!reloading) unsubscribe();
4939
+ if (!reloading && unsubscribe) unsubscribe();
4940
4940
  };
4941
4941
  dismiss = window.open(store);
4942
4942
  }
@@ -4944,10 +4944,14 @@ function createHotPromiseWindowFactoryWithProps(module, factory) {
4944
4944
  (_subscriberList = subscriberList) == null
4945
4945
  ? void 0
4946
4946
  : _subscriberList.subscribe(function (updatedFactory) {
4947
- reloading = true;
4948
4947
  factory = updatedFactory;
4949
- rerun();
4950
- reloading = false;
4948
+ setTimeout(function () {
4949
+ // timeout is required for proper module initialization
4950
+ // sometimes elements are defined in the lower part of the module and if the function is run immediately, it will fail
4951
+ reloading = true;
4952
+ rerun();
4953
+ reloading = false;
4954
+ }, 10);
4951
4955
  });
4952
4956
  rerun();
4953
4957
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "24.11.3",
3
+ "version": "24.11.4",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "src/index.js",
@@ -31,15 +31,19 @@ export function createHotPromiseWindowFactoryWithProps(module, factory) {
31
31
  dismiss?.();
32
32
  let window = Window.create(factory(props)(resolve, reject));
33
33
  window.overlayWillDismiss = () => {
34
- if (!reloading) unsubscribe();
34
+ if (!reloading && unsubscribe) unsubscribe();
35
35
  };
36
36
  dismiss = window.open(store);
37
37
  }
38
38
  unsubscribe = subscriberList?.subscribe((updatedFactory) => {
39
- reloading = true;
40
39
  factory = updatedFactory;
41
- rerun();
42
- reloading = false;
40
+ setTimeout(() => {
41
+ // timeout is required for proper module initialization
42
+ // sometimes elements are defined in the lower part of the module and if the function is run immediately, it will fail
43
+ reloading = true;
44
+ rerun();
45
+ reloading = false;
46
+ }, 10);
43
47
  });
44
48
  rerun();
45
49
  });