mirror of
https://github.com/seerr-team/seerr.git
synced 2026-08-03 03:38:04 -04:00
fix: stop plex settings hanging when tautulli fails to load
The loading guard required dataTautulli but only checked the Plex error, so a failed Tautulli request would leave the spinner up indefinitely in both setup and normal settings. Setup hides the Tautulli section entirely, so the request is skipped there rather than awaited.
This commit is contained in:
@@ -125,8 +125,13 @@ const SettingsPlex = ({ isSetupSettings }: SettingsPlexProps) => {
|
||||
error,
|
||||
mutate: revalidate,
|
||||
} = useSWR<PlexSettings>('/api/v1/settings/plex');
|
||||
const { data: dataTautulli, mutate: revalidateTautulli } =
|
||||
useSWR<TautulliSettings>('/api/v1/settings/tautulli');
|
||||
const {
|
||||
data: dataTautulli,
|
||||
error: errorTautulli,
|
||||
mutate: revalidateTautulli,
|
||||
} = useSWR<TautulliSettings>(
|
||||
isSetupSettings ? null : '/api/v1/settings/tautulli'
|
||||
);
|
||||
const { data: dataSync, mutate: revalidateSync } = useSWR<SyncStatus>(
|
||||
'/api/v1/settings/plex/sync',
|
||||
{
|
||||
@@ -334,7 +339,11 @@ const SettingsPlex = ({ isSetupSettings }: SettingsPlexProps) => {
|
||||
}
|
||||
};
|
||||
|
||||
if ((!data || !dataTautulli) && !error) {
|
||||
if (
|
||||
(!data || (!isSetupSettings && !dataTautulli)) &&
|
||||
!error &&
|
||||
!errorTautulli
|
||||
) {
|
||||
return <LoadingSpinner />;
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user