@steroidsjs/core 2.2.38 → 2.2.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.38",
3
+ "version": "2.2.39",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -29,7 +29,7 @@ export interface IFormProps {
29
29
  */
30
30
  actionMethod?: string;
31
31
  /**
32
- * Текст ошибки при неудачной отправке данных. По-умолчанию: "Не удалось отправить данные"
32
+ * Текст ошибки при неудачной отправке данных. По-умолчанию: "Ошибка сервера"
33
33
  * @example Упс, что-то пошло не так
34
34
  */
35
35
  submitErrorMessage?: string;
@@ -266,10 +266,9 @@ function Form(props) {
266
266
  requestError_1 = _c.sent();
267
267
  console.error(requestError_1); // eslint-disable-line no-console
268
268
  dispatch(form_2.formSetSubmitting(props.formId, false));
269
- reduxDispatch(notifications_1.showNotification(props.submitErrorMessage || __('Не удалось отправить данные'), 'danger'));
269
+ reduxDispatch(notifications_1.showNotification(props.submitErrorMessage || __('Ошибка сервера'), 'danger'));
270
270
  return [2 /*return*/, null];
271
271
  case 12:
272
- dispatch(form_2.formSetSubmitting(props.formId, false));
273
272
  // Skip on 2fa
274
273
  if (response.twoFactor) {
275
274
  dispatch(form_2.formSetSubmitting(props.formId, false));
@@ -286,6 +285,8 @@ function Form(props) {
286
285
  setErrors(data.errors);
287
286
  return [2 /*return*/, null];
288
287
  }
288
+ // Clean errors
289
+ setErrors(null);
289
290
  if (props.onComplete) {
290
291
  props.onComplete.call(null, cleanedValues, data, response);
291
292
  }
@@ -299,7 +300,8 @@ function Form(props) {
299
300
  }
300
301
  });
301
302
  });
302
- }, [dispatch, props, values, components.ui, components.resource, components.http, components.api, reduxDispatch, setErrors]);
303
+ }, [dispatch, props, values, components.ui, components.resource,
304
+ components.http, components.api, reduxDispatch, setErrors]);
303
305
  // Manual submit form by reducer action
304
306
  var prevSubmitCounter = react_use_1.usePrevious(submitCounter);
305
307
  react_use_1.useUpdateEffect(function () {