diff --git a/package.json b/package.json index f6e39a97..72fef768 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "i18next": "^21.9.2", "js-yaml": "^4.1.0", "json-rpc-2.0": "^1.4.1", + "lodash": "^4.17.21", "memory-cache": "^0.2.0", "minecraft-ping-js": "^1.0.2", "next": "^12.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c84dfffb..2227427b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ dependencies: json-rpc-2.0: specifier: ^1.4.1 version: 1.5.1 + lodash: + specifier: ^4.17.21 + version: 4.17.21 memory-cache: specifier: ^0.2.0 version: 0.2.0 diff --git a/src/components/widgets/resources/disk.jsx b/src/components/widgets/resources/disk.jsx index ccda2410..7541d9e0 100644 --- a/src/components/widgets/resources/disk.jsx +++ b/src/components/widgets/resources/disk.jsx @@ -1,3 +1,4 @@ +import _ from "lodash"; import useSWR from "swr"; import { FiHardDrive } from "react-icons/fi"; import { useTranslation } from "next-i18next"; @@ -16,7 +17,7 @@ export default function Disk({ options, expanded, refresh = 1500 }) { return } - if (!data) { + if (_.isEmpty(data)) { return