From 7bc2f94e2d06e00b602ad7367179757a7412a503 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Thu, 23 May 2024 20:42:57 +0200 Subject: [PATCH] fix: fixed widget activate threshold logic for the Network module (#1958) --- Modules/Net/main.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/Net/main.swift b/Modules/Net/main.swift index b079f6a51af..f0c99d13608 100644 --- a/Modules/Net/main.swift +++ b/Modules/Net/main.swift @@ -219,10 +219,12 @@ public class Network: Module { var upload: Int64 = value.bandwidth.upload var download: Int64 = value.bandwidth.download if self.widgetActivationThresholdState { + upload = 0 + download = 0 let threshold = self.widgetActivationThresholdSize.toBytes(self.widgetActivationThreshold) if value.bandwidth.upload >= threshold || value.bandwidth.download >= threshold { - upload = 0 - download = 0 + upload = value.bandwidth.upload + download = value.bandwidth.download } }