fix: fixed widget activate threshold logic for the Network module (#1958)

This commit is contained in:
Serhiy Mytrovtsiy
2024-05-23 20:42:57 +02:00
parent 7a0eb5ac87
commit 7bc2f94e2d

View File

@@ -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
}
}