mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix: fix a few misc unused imports and useless assignments/conditionals
This commit is contained in:
@@ -522,7 +522,7 @@ const MovieDetails: React.FC<MovieDetailsProps> = ({ movie }) => {
|
|||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
sliderKey="cast"
|
sliderKey="cast"
|
||||||
isLoading={!data && !error}
|
isLoading={false}
|
||||||
isEmpty={false}
|
isEmpty={false}
|
||||||
items={data?.credits.cast.slice(0, 20).map((person) => (
|
items={data?.credits.cast.slice(0, 20).map((person) => (
|
||||||
<PersonCard
|
<PersonCard
|
||||||
|
@@ -473,7 +473,7 @@ const TvDetails: React.FC<TvDetailsProps> = ({ tv }) => {
|
|||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
sliderKey="cast"
|
sliderKey="cast"
|
||||||
isLoading={!data && !error}
|
isLoading={false}
|
||||||
isEmpty={false}
|
isEmpty={false}
|
||||||
items={data?.credits.cast.slice(0, 20).map((person) => (
|
items={data?.credits.cast.slice(0, 20).map((person) => (
|
||||||
<PersonCard
|
<PersonCard
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import { User, useUser } from '../hooks/useUser';
|
import { User, useUser } from '../hooks/useUser';
|
||||||
import { useRouter } from 'next/dist/client/router';
|
import { useRouter } from 'next/dist/client/router';
|
||||||
|
|
||||||
@@ -17,20 +17,19 @@ export const UserContext: React.FC<UserContextProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { user, error, revalidate } = useUser({ initialData: initialUser });
|
const { user, error, revalidate } = useUser({ initialData: initialUser });
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const routing = useRef(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
revalidate();
|
revalidate();
|
||||||
}, [router.pathname, revalidate]);
|
}, [router.pathname, revalidate]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let routing = false;
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!router.pathname.match(/(setup|login)/) &&
|
!router.pathname.match(/(setup|login)/) &&
|
||||||
(!user || error) &&
|
(!user || error) &&
|
||||||
!routing
|
!routing.current
|
||||||
) {
|
) {
|
||||||
routing = true;
|
routing.current = true;
|
||||||
location.href = '/login';
|
location.href = '/login';
|
||||||
}
|
}
|
||||||
}, [router, user, error]);
|
}, [router, user, error]);
|
||||||
|
@@ -100,13 +100,11 @@ CoreApp.getInitialProps = async (initialProps) => {
|
|||||||
|
|
||||||
if (ctx.res) {
|
if (ctx.res) {
|
||||||
// Check if app is initialized and redirect if necessary
|
// Check if app is initialized and redirect if necessary
|
||||||
let initialized = true;
|
|
||||||
|
|
||||||
const response = await axios.get<{ initialized: boolean }>(
|
const response = await axios.get<{ initialized: boolean }>(
|
||||||
`http://localhost:${process.env.PORT || 3000}/api/v1/settings/public`
|
`http://localhost:${process.env.PORT || 3000}/api/v1/settings/public`
|
||||||
);
|
);
|
||||||
|
|
||||||
initialized = response.data.initialized;
|
const initialized = response.data.initialized;
|
||||||
|
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
if (!router.pathname.match(/(setup|login\/plex)/)) {
|
if (!router.pathname.match(/(setup|login\/plex)/)) {
|
||||||
|
Reference in New Issue
Block a user