Panayiotis Lipiridis 4 éve
szülő
commit
dc95cf3447
2 módosított fájl, 3 hozzáadás és 3 törlés
  1. 2 2
      src/components/Stats.tsx
  2. 1 1
      src/utils.ts

+ 2 - 2
src/components/Stats.tsx

@@ -11,7 +11,7 @@ import { t } from "../i18n";
 import useIsMobile from "../is-mobile";
 import { getTargetElements } from "../scene";
 import { AppState } from "../types";
-import { debounce, formatSpeed, getVersion, nFormatter } from "../utils";
+import { debounce, formatSpeedBytes, getVersion, nFormatter } from "../utils";
 import { close } from "./icons";
 import { Island } from "./Island";
 import "./Stats.scss";
@@ -186,7 +186,7 @@ export const Stats = (props: {
                     {props.appState.networkSpeed === 0
                       ? "…"
                       : props.appState.networkSpeed > 0
-                      ? formatSpeed(props.appState.networkSpeed)
+                      ? formatSpeedBytes(props.appState.networkSpeed)
                       : t("stats.error")}
                   </td>
                 </tr>

+ 1 - 1
src/utils.ts

@@ -363,7 +363,7 @@ export const nFormatter = (num: number, digits: number): string => {
   );
 };
 
-export const formatSpeed = (speed: number): string => {
+export const formatSpeedBytes = (speed: number): string => {
   // source: en.wikipedia.org/wiki/Data-rate_units#Conversion_table
   const suffix = ["B/s", "kB/s", "MB/s", "GB/s"];
   let index = 0;