Frontend: Fix broken links in /plugins when pathname has a trailing slash (#64348)

Fix broken links in /plugins when pathname has a trailing slash
pull/64609/head
William Assis 2 years ago committed by GitHub
parent 2f55911fa3
commit a05cb1e78e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/features/plugins/admin/components/PluginList.tsx

@ -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">

Loading…
Cancel
Save