chrv-components 1.12.88 → 1.12.89

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.
Binary file
@@ -4820,6 +4820,7 @@ class ChrButtonComponent {
4820
4820
  this.onAction = output();
4821
4821
  this.loading = model(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
4822
4822
  this.handleClick = (event) => {
4823
+ this.loading.set(true);
4823
4824
  const click = this.action();
4824
4825
  const result = typeof click === 'function' ? click() : click;
4825
4826
  const obs = result instanceof Promise || (result && typeof result.then === 'function')
@@ -4827,13 +4828,14 @@ class ChrButtonComponent {
4827
4828
  : result instanceof Observable
4828
4829
  ? result
4829
4830
  : result;
4830
- if (obs instanceof Observable)
4831
- this.loading.set(true);
4832
4831
  if (result)
4833
4832
  result.subscribe({
4834
4833
  complete: () => this.loading.set(false),
4835
4834
  error: () => this.loading.set(false),
4836
4835
  });
4836
+ else {
4837
+ this.loading.set(false);
4838
+ }
4837
4839
  return { event: event, value: obs };
4838
4840
  };
4839
4841
  }