@applica-software-guru/react-admin 1.3.131 → 1.3.133

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": "@applica-software-guru/react-admin",
3
- "version": "1.3.131",
3
+ "version": "1.3.133",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';
2
2
  import { useActiveItem, useFormRootPath, useItems } from './Provider';
3
3
  import { IItem } from './types';
4
4
  import { getChildren, isChild } from './utils';
5
- import { useNavigate } from 'react-router';
5
+ import { useLocation, useNavigate } from 'react-router';
6
6
 
7
7
  function useIsActive(id: string): boolean {
8
8
  const activeItem = useActiveItem();
@@ -22,10 +22,11 @@ function useChildren(id?: string): Array<IItem> {
22
22
 
23
23
  function useNavigateForm(): (id: string) => void {
24
24
  const formRootPath = useFormRootPath(),
25
+ { search } = useLocation(),
25
26
  navigate = useNavigate(),
26
27
  navigateSection = useCallback(
27
28
  (id: string) => {
28
- navigate(`${formRootPath}/${id}`);
29
+ navigate(`${formRootPath}/${id}${search}`);
29
30
  },
30
31
  [formRootPath, navigate]
31
32
  );
@@ -29,7 +29,11 @@ const useErrorEventCatcher = ({
29
29
  const consoleError = console.error;
30
30
  const handleError = React.useCallback(
31
31
  function (event: ErrorEvent | string, ...args: any[]) {
32
- const catchResult = catcherFn(event instanceof ErrorEvent ? event : event.replace(/%s/g, () => args.shift()));
32
+ if (!event) {
33
+ return false;
34
+ }
35
+
36
+ const catchResult = catcherFn(event instanceof ErrorEvent ? event : event?.toString()?.replace(/%s/g, () => args.shift()));
33
37
  if (catchResult.isCatched()) {
34
38
  return false;
35
39
  }