@antscorp/antsomi-ui 1.3.5-beta.604 → 1.3.5-beta.605

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.
@@ -13,6 +13,7 @@ import { DASHBOARD_MODULE_CONFIG } from '../../../template/Layout/constants';
13
13
  import { usePermission } from './usePermission';
14
14
  import { useCustomRouter, useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks';
15
15
  import { useNavigatePath } from './useNavigatePath';
16
+ const cookies = new ReactCookies();
16
17
  export const useLeftMenu = (props) => {
17
18
  // Props
18
19
  const { objectType = DASHBOARD_MODULE_CONFIG.objectType, objectId = DASHBOARD_MODULE_CONFIG.objectId, isGrouped = DASHBOARD_MODULE_CONFIG.isGrouped, appConfig, customization, onActiveMenuCodeChange, } = props;
@@ -36,7 +37,6 @@ export const useLeftMenu = (props) => {
36
37
  return activeKey;
37
38
  }
38
39
  }, [activeKey, type]);
39
- const cookies = new ReactCookies();
40
40
  const { pathname, hash, origin } = window.location;
41
41
  const { navigate } = useCustomRouter();
42
42
  const { isPushDifferentDomain, getPath, navigatePath } = useNavigatePath();
@@ -67,16 +67,16 @@ export const useLeftMenu = (props) => {
67
67
  }
68
68
  onMenuItemClick === null || onMenuItemClick === void 0 ? void 0 : onMenuItemClick(key, [...keyPath, customActiveAppKey]);
69
69
  }, [customActiveAppKey, onMenuItemClick, setLeftMenuContextState, type]);
70
- useDeepCompareEffect(() => {
70
+ useEffect(() => {
71
71
  if (defaultExpandMenu === undefined) {
72
72
  cookies.set('_leftmenu_state', state.isExpandMenu ? 1 : 0, {
73
- domain: `.${origin.split('.').splice(-2).join('.')}`,
73
+ domain: `.${window.location.origin.split('.').splice(-2).join('.')}`,
74
74
  path: '/',
75
75
  sameSite: 'none',
76
76
  secure: true,
77
77
  });
78
78
  }
79
- }, [cookies, defaultExpandMenu, origin, state.isExpandMenu]);
79
+ }, [defaultExpandMenu, state.isExpandMenu]);
80
80
  useDeepCompareEffect(() => {
81
81
  setLeftMenuContextState({
82
82
  appConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.604",
3
+ "version": "1.3.5-beta.605",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",