diff --git a/core/frontend/src/store/system-information.ts b/core/frontend/src/store/system-information.ts index c3e98efb10..c5f148647e 100644 --- a/core/frontend/src/store/system-information.ts +++ b/core/frontend/src/store/system-information.ts @@ -182,8 +182,8 @@ class SystemInformationStore extends VuexModule { const dt = (now - (previousNetwork?.last_update ?? 5)) / 1000 network.last_update = now if (previousNetwork) { - network.download_speed = (network.total_received_B - previousNetwork.total_received_B) / dt - network.upload_speed = (network.total_transmitted_B - previousNetwork.total_transmitted_B) / dt + network.download_speed = Math.max(0, (network.total_received_B - previousNetwork.total_received_B) / dt) + network.upload_speed = Math.max(0, (network.total_transmitted_B - previousNetwork.total_transmitted_B) / dt) } } this.system.network = networks diff --git a/core/frontend/src/utils/networking.ts b/core/frontend/src/utils/networking.ts index d5f271696e..631d678547 100644 --- a/core/frontend/src/utils/networking.ts +++ b/core/frontend/src/utils/networking.ts @@ -1,5 +1,5 @@ export function formatBandwidth(bytesPerSecond: number): string { - const mbps = (8 * bytesPerSecond / 1024 / 1024) + const mbps = (8 * Math.max(0, bytesPerSecond) / 1024 / 1024) const decimal_places = mbps < 10 ? 2 : mbps < 100 ? 1 : 0 return `${mbps.toFixed(decimal_places)}Mbps` }