Browse Source

fix: admin sidebar button uses router navigate instead of window.location.hash

- openAdmin triggers SolidJS router navigate('/admin')
- Clicking shield icon now navigates to admin panel correctly
KirinCode 1 tháng trước cách đây
mục cha
commit
5c4342d22c
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      packages/app/src/pages/layout.tsx

+ 3 - 1
packages/app/src/pages/layout.tsx

@@ -1120,6 +1120,8 @@ export default function LegacyLayout(props: ParentProps) {
     })
   }
 
+  const openAdmin = () => navigate("/admin")
+
   function projectRoot(directory: string) {
     const key = pathKey(directory)
     const project = layout.projects
@@ -2240,7 +2242,7 @@ export default function LegacyLayout(props: ParentProps) {
       helpLabel={() => language.t("sidebar.help")}
       onOpenHelp={() => platform.openLink("https://kailin.com.cn/feedback")}
       adminLabel={() => "团队管理"}
-      onOpenAdmin={() => window.location.hash = "/admin"}
+      onOpenAdmin={openAdmin}
       renderPanel={() =>
         mobile ? <SidebarPanel project={currentProject} mobile /> : <SidebarPanel project={currentProject} merged />
       }