Skip to content

Commit

Permalink
fix: fixed widget activate threshold logic for the Network module (#1958
Browse files Browse the repository at this point in the history
)
  • Loading branch information
exelban committed May 23, 2024
1 parent 7a0eb5a commit 7bc2f94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Modules/Net/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 7bc2f94

Please sign in to comment.