From 1106399f8b7de41a569bec34e114d219650cb8a6 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 7 Oct 2020 06:12:03 +0100 Subject: [PATCH] if the uploader is finished show 0 speed --- .../src/main/groovy/com/muwire/clilanterna/UploadsModel.groovy | 3 +++ gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cli-lanterna/src/main/groovy/com/muwire/clilanterna/UploadsModel.groovy b/cli-lanterna/src/main/groovy/com/muwire/clilanterna/UploadsModel.groovy index cb888ccd..db30b93f 100644 --- a/cli-lanterna/src/main/groovy/com/muwire/clilanterna/UploadsModel.groovy +++ b/cli-lanterna/src/main/groovy/com/muwire/clilanterna/UploadsModel.groovy @@ -109,6 +109,9 @@ class UploadsModel { } public int speed() { + if (finished) + return 0 + if (speedArray.length != core.muOptions.speedSmoothSeconds) { speedArray = new int[core.muOptions.speedSmoothSeconds] speedPos = 0 diff --git a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy index cb7e5875..20e72a65 100644 --- a/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy +++ b/gui/griffon-app/models/com/muwire/gui/MainFrameModel.groovy @@ -683,6 +683,9 @@ class MainFrameModel { public int speed() { + if (finished) + return 0 + if (speedArray.length != core.muOptions.speedSmoothSeconds) { speedArray = new int[core.muOptions.speedSmoothSeconds] speedPos = 0