Fix coding standards for typescript-eslint 8

This commit is contained in:
Alejandro Celaya
2024-08-07 12:23:03 +02:00
parent 81ea262999
commit a8258ff2cc
16 changed files with 48 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ type WithSelectedServerPropsDeps = {
ServerError: FC;
};
export function withSelectedServer<T = {}>(
export function withSelectedServer<T extends object>(
WrappedComponent: FCWithDeps<WithSelectedServerProps & T, WithSelectedServerPropsDeps>,
) {
const ComponentWrapper: FCWithDeps<WithSelectedServerProps & T, WithSelectedServerPropsDeps> = (props) => {
@@ -26,7 +26,9 @@ export function withSelectedServer<T = {}>(
const { selectServer, selectedServer } = props;
useEffect(() => {
params.serverId && selectServer(params.serverId);
if (params.serverId) {
selectServer(params.serverId);
}
}, [params.serverId, selectServer]);
if (!selectedServer) {