diff --git a/Plan/react/dashboard/src/components/CardTabs.js b/Plan/react/dashboard/src/components/CardTabs.js index 8c0d98714..3afa428a6 100644 --- a/Plan/react/dashboard/src/components/CardTabs.js +++ b/Plan/react/dashboard/src/components/CardTabs.js @@ -1,14 +1,15 @@ import React, {useEffect, useState} from "react"; -import {useLocation} from "react-router-dom"; +import {useLocation, useNavigate} from "react-router-dom"; import {FontAwesomeIcon as Fa} from "@fortawesome/react-fontawesome"; const TabButton = ({name, href, icon, color, active}) => { + const navigate = useNavigate(); return (
  • - +
  • ) } diff --git a/Plan/react/dashboard/src/components/cards/network/ServersTableCard.js b/Plan/react/dashboard/src/components/cards/network/ServersTableCard.js index 4050455fe..1f0807827 100644 --- a/Plan/react/dashboard/src/components/cards/network/ServersTableCard.js +++ b/Plan/react/dashboard/src/components/cards/network/ServersTableCard.js @@ -7,6 +7,7 @@ import {FontAwesomeIcon as Fa} from "@fortawesome/react-fontawesome"; import DropdownToggle from "react-bootstrap-v5/lib/esm/DropdownToggle"; import DropdownMenu from "react-bootstrap-v5/lib/esm/DropdownMenu"; import DropdownItem from "react-bootstrap-v5/lib/esm/DropdownItem"; +import {CardLoader} from "../../navigation/Loader"; const SortDropDown = ({sortBy, sortReversed, setSortBy}) => { const {t} = useTranslation(); @@ -35,11 +36,15 @@ const SortDropDown = ({sortBy, sortReversed, setSortBy}) => { ) } -const ServersTableCard = ({servers, onSelect}) => { +const ServersTableCard = ({loaded, servers, onSelect}) => { const {t} = useTranslation(); const [sortBy, setSortBy] = useState(ServerSortOption.ALPHABETICAL); const [sortReversed, setSortReversed] = useState(false); + if (!loaded) { + return + } + const setSort = option => { if (sortBy === option) { setSortReversed(!sortReversed); @@ -62,10 +67,10 @@ const ServersTableCard = ({servers, onSelect}) => {

    It appears that Plan is not installed on any game servers or not connected to the same database. See wiki for Network tutorial.

    } - {servers.length && } + {Boolean(servers.length) && } ) }; diff --git a/Plan/react/dashboard/src/views/network/NetworkServers.js b/Plan/react/dashboard/src/views/network/NetworkServers.js index 1f0202c92..b078ecd51 100644 --- a/Plan/react/dashboard/src/views/network/NetworkServers.js +++ b/Plan/react/dashboard/src/views/network/NetworkServers.js @@ -19,7 +19,8 @@ const NetworkServers = () => { return ( - setSelectedServer(index)}/> + setSelectedServer(index)}/> {data?.servers.length && }