mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed widget activate threshold logic for the Network module (#1958)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user