Thanks for that highlight phpstorm...
This commit is contained in:
parent
283cb08e33
commit
31ad238e8b
1 changed files with 3 additions and 6 deletions
|
@ -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);
|
.then(data => setStats(data))
|
||||||
return getServerResourceUsage(server.uuid)
|
.catch(error => console.error(error));
|
||||||
.then(data => setStats(data))
|
|
||||||
.catch(error => console.error(error));
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsSuspended(stats?.isSuspended || server.isSuspended);
|
setIsSuspended(stats?.isSuspended || server.isSuspended);
|
||||||
|
|
Loading…
Reference in a new issue