diff --git a/resources/scripts/components/dashboard/ServerRow.tsx b/resources/scripts/components/dashboard/ServerRow.tsx index 9a6eda950..e3a96850d 100644 --- a/resources/scripts/components/dashboard/ServerRow.tsx +++ b/resources/scripts/components/dashboard/ServerRow.tsx @@ -46,7 +46,7 @@ const StatusIndicatorBox = styled(GreyRowBox)<{ $status: ServerPowerState | unde type Timer = ReturnType; export default ({ server, className }: { server: Server; className?: string }) => { - const interval = useRef(null) as React.MutableRefObject; + const interval = useRef(null) as React.MutableRefObject; const [isSuspended, setIsSuspended] = useState(server.status === 'suspended'); const [stats, setStats] = useState(null); @@ -67,7 +67,9 @@ export default ({ server, className }: { server: Server; className?: string }) = }); return () => { - interval.current && clearInterval(interval.current); + if (interval.current) { + clearInterval(interval.current); + } }; }, [isSuspended]); @@ -105,13 +107,13 @@ export default ({ server, className }: { server: Server; className?: string }) =
{!stats || isSuspended ? ( isSuspended ? ( -
+
{server.status === 'suspended' ? 'Suspended' : 'Connection Error'}
) : server.isTransferring || server.status ? ( -
+
{server.isTransferring ? 'Transferring' @@ -129,9 +131,9 @@ export default ({ server, className }: { server: Server; className?: string }) =
{stats && ( -
+
-
+
@@ -139,7 +141,7 @@ export default ({ server, className }: { server: Server; className?: string }) =
-
+
@@ -147,7 +149,7 @@ export default ({ server, className }: { server: Server; className?: string }) =
-
+
{bytesToString(stats?.diskUsageInBytes)}