From 31ad238e8b0d57da635e61599831bed2f6f74a5c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 31 Oct 2020 14:11:53 -0700 Subject: [PATCH] Thanks for that highlight phpstorm... --- resources/scripts/components/dashboard/ServerRow.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/scripts/components/dashboard/ServerRow.tsx b/resources/scripts/components/dashboard/ServerRow.tsx index 3a32ff74..d42b3e43 100644 --- a/resources/scripts/components/dashboard/ServerRow.tsx +++ b/resources/scripts/components/dashboard/ServerRow.tsx @@ -44,12 +44,9 @@ export default ({ server, className }: { server: Server; className?: string }) = const [ isSuspended, setIsSuspended ] = useState(server.isSuspended); const [ stats, setStats ] = useState(null); - const getStats = () => { - setStatsError(false); - return getServerResourceUsage(server.uuid) - .then(data => setStats(data)) - .catch(error => console.error(error)); - }; + const getStats = () => getServerResourceUsage(server.uuid) + .then(data => setStats(data)) + .catch(error => console.error(error)); useEffect(() => { setIsSuspended(stats?.isSuspended || server.isSuspended);