Skip to content

Commit

Permalink
feat: open home in current tab (close alist-org/alist#4784)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 21, 2023
1 parent e947533 commit 966576f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/pages/manage/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SideMenuItemProps {
children?: SideMenuItemProps[]
role?: number
external?: true
refresh?: true
}

const SideMenuItem = (props: SideMenuItemProps) => {
Expand Down Expand Up @@ -48,9 +49,13 @@ const SideMenuItemWithTo = (props: SideMenuItemProps) => {
display="flex"
as={Link}
href={props.to}
onClick={() => {
onClick={(e: any) => {
// to(props.to!);
onClose()
if (props.refresh) {
e.stopPropagation?.()
window.open(props.to, "_self")
}
}}
w="$full"
alignItems="center"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/manage/sidemenu_items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ export const side_menu_items: SideMenuItem[] = [
icon: IoHome,
to: "/",
role: UserRole.GUEST,
external: true,
refresh: true,
},
]

0 comments on commit 966576f

Please sign in to comment.