This commit is contained in:
Panayiotis Lipiridis
2021-02-07 14:33:26 +02:00
parent bc9c8f7ee2
commit 1ca985aa4a
7 changed files with 35 additions and 19 deletions
+8 -2
View File
@@ -11,7 +11,7 @@ import { t } from "../i18n";
import useIsMobile from "../is-mobile";
import { getTargetElements } from "../scene";
import { AppState } from "../types";
import { debounce, getVersion, nFormatter } from "../utils";
import { debounce, formatSpeed, getVersion, nFormatter } from "../utils";
import { close } from "./icons";
import { Island } from "./Island";
import "./Stats.scss";
@@ -182,7 +182,13 @@ export const Stats = (props: {
</tr>
<tr>
<td>{t("stats.speed")}</td>
<td>{props.appState.networkSpeed}</td>
<td>
{props.appState.networkSpeed === 0
? "…"
: props.appState.networkSpeed > 0
? formatSpeed(props.appState.networkSpeed)
: t("stats.error")}
</td>
</tr>
</>
) : null}