2022-01-22 13:35:11 +00:00
|
|
|
import { useIsRadarrEnabled, useIsSonarrEnabled } from "@redux/hooks";
|
2021-09-03 01:35:46 +00:00
|
|
|
import { FunctionComponent } from "react";
|
|
|
|
import { Redirect } from "react-router-dom";
|
|
|
|
|
|
|
|
const RootRedirect: FunctionComponent = () => {
|
|
|
|
const sonarr = useIsSonarrEnabled();
|
|
|
|
const radarr = useIsRadarrEnabled();
|
|
|
|
|
|
|
|
let path = "/settings";
|
|
|
|
if (sonarr) {
|
|
|
|
path = "/series";
|
|
|
|
} else if (radarr) {
|
|
|
|
path = "movies";
|
|
|
|
}
|
|
|
|
|
|
|
|
return <Redirect to={path}></Redirect>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RootRedirect;
|