Skip to content

Commit

Permalink
Frontend: Fix broken links in /plugins when pathname has a trailing s…
Browse files Browse the repository at this point in the history
…lash (#64348)

Fix broken links in /plugins when pathname has a trailing slash
  • Loading branch information
gassiss authored Mar 10, 2023
1 parent 2f55911 commit a05cb1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/app/features/plugins/admin/components/PluginList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ interface Props {
export const PluginList = ({ plugins, displayMode }: Props) => {
const isList = displayMode === PluginListDisplayMode.List;
const styles = useStyles2(getStyles);
const location = useLocation();
const pathName = config.appSubUrl + location.pathname;
const { pathname } = useLocation();
const pathName = config.appSubUrl + (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname);

return (
<div className={cx(styles.container, { [styles.list]: isList })} data-testid="plugin-list">
Expand Down

0 comments on commit a05cb1e

Please sign in to comment.