diff --git a/client/src/HelperFunctions.js b/client/src/HelperFunctions.js index 1271b670..c8a31946 100644 --- a/client/src/HelperFunctions.js +++ b/client/src/HelperFunctions.js @@ -20,7 +20,7 @@ export function generateRelativeTime(created) { export function getIconBySpeed(current, optional, higherIsBetter) { let speed = Math.floor((current / optional) * 100); - if (current === 0) return "error"; + if (current === -1) return "error"; if (higherIsBetter) { if (speed >= 75) return "green"; diff --git a/client/src/components/LatestTestComponent.js b/client/src/components/LatestTestComponent.js index d359a2dd..c390d9a5 100644 --- a/client/src/components/LatestTestComponent.js +++ b/client/src/components/LatestTestComponent.js @@ -46,7 +46,7 @@ function LatestTestComponent() {

Pingms

-

{latest.ping === 0 ? "Test" : latest.ping}

+

{latest.ping === -1 ? "Test" : latest.ping}

@@ -61,7 +61,7 @@ function LatestTestComponent() {

DownloadMbit/s

-

{latest.download === 0 ? "schlug" : latest.download}

+

{latest.download === -1 ? "schlug" : latest.download}

@@ -76,7 +76,7 @@ function LatestTestComponent() {

UploadMbit/s

-

{latest.upload === 0 ? "fehl!" : latest.upload}

+

{latest.upload === -1 ? "fehl!" : latest.upload}

diff --git a/client/src/components/SpeedtestComponent.js b/client/src/components/SpeedtestComponent.js index 7cf115a4..abdba25e 100644 --- a/client/src/components/SpeedtestComponent.js +++ b/client/src/components/SpeedtestComponent.js @@ -21,15 +21,15 @@ class Speedtest extends Component {
-

{this.props.ping === 0 ? "" : this.props.ping}

+

{this.props.ping === -1 ? "" : this.props.ping}

-

{this.props.down === 0 ? "" : this.props.down}

+

{this.props.down === -1 ? "" : this.props.down}

-

{this.props.up === 0 ? "" : this.props.up}

+

{this.props.up === -1 ? "" : this.props.up}

diff --git a/server/tasks/speedtest.js b/server/tasks/speedtest.js index 9fa7e8b7..ec62d2d4 100644 --- a/server/tasks/speedtest.js +++ b/server/tasks/speedtest.js @@ -49,7 +49,7 @@ module.exports.create = async () => { console.log(`Test #${testResult} was executed successfully. 🏓 ${ping} ⬇ ${download}️ ⬆ ${upload}️`); createRecommendations().then(() => ""); } catch (e) { - let testResult = tests.create(0, 0, 0); + let testResult = tests.create(-1, -1, -1); console.log(`Test #${testResult} was not executed successfully. Please try reconnecting to the internet or restarting the software.`); } isRunning = false;