ar-design 0.3.43 → 0.3.44

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.
@@ -49,13 +49,13 @@ const Menu = ({ data, variant = "vertical", ...attributes }) => {
49
49
  };
50
50
  // useEffects
51
51
  useEffect(() => {
52
+ if (data.length === 0)
53
+ return;
52
54
  const stored = JSON.parse(sessionStorage.getItem(sessionStorageKey) ?? "{}");
53
- if (stored)
54
- setSelectedItem(stored);
55
- else
56
- setSelectedItem(data[0]);
55
+ const _menuItem = (Object.keys(stored).length > 0 ? stored : data[0]);
56
+ setSelectedItem(_menuItem);
57
57
  // DOM üzerinde seçili li elementini bul ve üst menüleri aç
58
- const li = document.querySelector(`li[data-menu-id="ar-menu-${stored.key}"]`);
58
+ const li = document.querySelector(`li[data-menu-id="ar-menu-${_menuItem.key}"]`);
59
59
  openParentMenusDOM(li);
60
60
  }, [data]);
61
61
  return (React.createElement("nav", { className: "ar-menu", ...attributes },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.3.43",
3
+ "version": "0.3.44",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",