mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-05-31 09:36:17 +00:00
Migrated to TS main services except ShlinkApiClient
This commit is contained in:
@@ -35,3 +35,6 @@ export const isReachableServer = (server: SelectedServer): server is ReachableSe
|
||||
|
||||
export const isServerWithId = (server: SelectedServer | ServerWithId): server is ServerWithId =>
|
||||
!!server?.hasOwnProperty('id');
|
||||
|
||||
export const isNotFoundServer = (server: SelectedServer): server is NotFoundServer =>
|
||||
!!server?.hasOwnProperty('serverNotFound');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { FC, useEffect } from 'react';
|
||||
import { RouteChildrenProps } from 'react-router';
|
||||
import Message from '../../utils/Message';
|
||||
import { isReachableServer, SelectedServer } from '../data';
|
||||
import { isNotFoundServer, SelectedServer } from '../data';
|
||||
|
||||
interface WithSelectedServerProps extends RouteChildrenProps<{ serverId: string }> {
|
||||
selectServer: (serverId: string) => void;
|
||||
@@ -21,7 +21,7 @@ export const withSelectedServer = (WrappedComponent: FC<WithSelectedServerProps>
|
||||
return <Message loading />;
|
||||
}
|
||||
|
||||
if (!isReachableServer(selectedServer)) {
|
||||
if (isNotFoundServer(selectedServer)) {
|
||||
return <ServerError />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user