Remove unnecessary double type check

This commit is contained in:
Alejandro Celaya 2023-12-13 09:35:48 +01:00
parent adb50a91e7
commit d154820b28

View file

@ -29,13 +29,12 @@ ShlinkWebComponentContainerDeps
ShlinkWebComponent, ShlinkWebComponent,
ServerError, ServerError,
} = useDependencies(ShlinkWebComponentContainer); } = useDependencies(ShlinkWebComponentContainer);
const selectedServerIsReachable = isReachableServer(selectedServer);
const routesPrefix = selectedServerIsReachable ? `/server/${selectedServer.id}` : '';
if (!selectedServerIsReachable) { if (!isReachableServer(selectedServer)) {
return <ServerError />; return <ServerError />;
} }
const routesPrefix = `/server/${selectedServer.id}`;
return ( return (
<ShlinkWebComponent <ShlinkWebComponent
serverVersion={selectedServer.version} serverVersion={selectedServer.version}