Skip to content

Commit

Permalink
Remove unnecessary double type check
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Dec 13, 2023
1 parent adb50a9 commit d154820
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/common/ShlinkWebComponentContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit d154820

Please sign in to comment.