perf: sidePanel Section Delete

This commit is contained in:
JOYCEQL
2024-11-22 15:02:47 +08:00
parent 09f9cf762c
commit 7f3b628451
@@ -216,7 +216,11 @@ export function SidePanel() {
updateMenuSections(
menuSections.filter((section) => section.id !== item.id)
);
setActiveSection(menuSections[0].id);
setActiveSection(
menuSections[
menuSections.findIndex((s) => s.id === item.id) - 1
].id
);
}}
className={cn(
"p-1.5 rounded-md text-primary",