@stemy/ngx-utils 19.8.1 → 19.8.2
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.
|
@@ -5976,9 +5976,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5976
5976
|
}]
|
|
5977
5977
|
}] });
|
|
5978
5978
|
|
|
5979
|
-
async function defaultMethod() {
|
|
5980
|
-
return null;
|
|
5981
|
-
}
|
|
5982
5979
|
class AsyncMethodBase {
|
|
5983
5980
|
constructor() {
|
|
5984
5981
|
this.disabled = signal(false);
|
|
@@ -6018,17 +6015,17 @@ class AsyncMethodBase {
|
|
|
6018
6015
|
if (this.loading())
|
|
6019
6016
|
return true;
|
|
6020
6017
|
this.loading.set(true);
|
|
6021
|
-
const method = this.getMethod()
|
|
6022
|
-
const result = method(...this.getArgs(ev));
|
|
6018
|
+
const method = this.getMethod();
|
|
6019
|
+
const result = !method ? null : method(...this.getArgs(ev));
|
|
6023
6020
|
if (!(result instanceof Promise)) {
|
|
6024
6021
|
this.loading.set(false);
|
|
6025
6022
|
return false;
|
|
6026
6023
|
}
|
|
6027
|
-
result.then(
|
|
6024
|
+
result.then(msg => {
|
|
6028
6025
|
this.loading.set(false);
|
|
6029
|
-
if (
|
|
6030
|
-
this.onSuccess.emit(
|
|
6031
|
-
this.toaster.success(
|
|
6026
|
+
if (msg) {
|
|
6027
|
+
this.onSuccess.emit(msg);
|
|
6028
|
+
this.toaster.success(msg.message, msg.context);
|
|
6032
6029
|
}
|
|
6033
6030
|
}, reason => {
|
|
6034
6031
|
if (!reason || !reason.message)
|