mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove broken redirects
This commit is contained in:
parent
9438dcbb4c
commit
e9464b2c6b
6 changed files with 8 additions and 90 deletions
|
@ -1,25 +0,0 @@
|
|||
import React from 'react';
|
||||
import { Navigate, RouteObject, useLocation } from 'react-router-dom';
|
||||
|
||||
export interface Redirect {
|
||||
from: string
|
||||
to: string
|
||||
}
|
||||
|
||||
const RedirectWithSearch = ({ to }: { to: string }) => {
|
||||
const { search } = useLocation();
|
||||
|
||||
return (
|
||||
<Navigate
|
||||
replace
|
||||
to={`${to}${search}`}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export function toRedirectRoute({ from, to }: Redirect): RouteObject {
|
||||
return {
|
||||
path: from,
|
||||
element: <RedirectWithSearch to={to} />
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue