mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Frontend: Fix broken links in /plugins when pathname has a trailing slash (#64348)
Fix broken links in /plugins when pathname has a trailing slash
This commit is contained in:
parent
2f55911fa3
commit
a05cb1e78e
@ -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…
Reference in New Issue
Block a user