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,
ServerError,
} = useDependencies(ShlinkWebComponentContainer);
const selectedServerIsReachable = isReachableServer(selectedServer);
const routesPrefix = selectedServerIsReachable ? `/server/${selectedServer.id}` : '';
if (!selectedServerIsReachable) {
if (!isReachableServer(selectedServer)) {
return <ServerError />;
}
const routesPrefix = `/server/${selectedServer.id}`;
return (
<ShlinkWebComponent
serverVersion={selectedServer.version}