1
0
Fork 0
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:
Bill Thornton 2024-09-13 10:17:29 -04:00
parent 9438dcbb4c
commit e9464b2c6b
6 changed files with 8 additions and 90 deletions

View file

@ -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} />
};
}