Merge branch 'develop' into pr/2434

This commit is contained in:
Dane Everitt 2020-10-31 14:12:13 -07:00
commit 7638ffccde
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -44,12 +44,9 @@ export default ({ server, className }: { server: Server; className?: string }) =
const [ isSuspended, setIsSuspended ] = useState(server.isSuspended); const [ isSuspended, setIsSuspended ] = useState(server.isSuspended);
const [ stats, setStats ] = useState<ServerStats | null>(null); const [ stats, setStats ] = useState<ServerStats | null>(null);
const getStats = () => { const getStats = () => getServerResourceUsage(server.uuid)
setStatsError(false);
return getServerResourceUsage(server.uuid)
.then(data => setStats(data)) .then(data => setStats(data))
.catch(error => console.error(error)); .catch(error => console.error(error));
};
useEffect(() => { useEffect(() => {
setIsSuspended(stats?.isSuspended || server.isSuspended); setIsSuspended(stats?.isSuspended || server.isSuspended);