Skip to content

Commit

Permalink
fix network reader after reconnection to the network
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban committed Jun 21, 2020
1 parent b22c741 commit de64f94
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion Modules/Net/popup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ internal class Popup: NSView {

public func usageCallback(_ value: Usage) {
DispatchQueue.main.async(execute: {
if !self.window!.isVisible && self.initialized {
if !self.window!.isVisible && self.initialized && value.active {
return
}

Expand Down
2 changes: 0 additions & 2 deletions Modules/Net/readers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ internal class UsageReader: Reader<Usage> {

self.reachability!.whenReachable = { _ in
self.readInformation()
self.start()
}
self.reachability!.whenUnreachable = { _ in
self.usage.reset()
self.callback(self.usage)
self.stop()
}
}

Expand Down
4 changes: 0 additions & 4 deletions Stats/Views/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ private class SettingsView: NSView {
NSWorkspace.shared.open(URL(string: "https://github.com/exelban/stats/issues/new")!)
}

@objc public func aboutApp(_ sender: Any) {
print("about app")
}

@objc public func closeApp(_ sender: Any) {
NSApp.terminate(sender)
}
Expand Down
1 change: 0 additions & 1 deletion StatsKit/SystemKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public class SystemKit {
name = name.replacingOccurrences(of: "CPU", with: "")
name = name.replacingOccurrences(of: " @ ", with: "")
}
print(name)

var size = UInt32(MemoryLayout<host_basic_info_data_t>.size / MemoryLayout<integer_t>.size)
let hostInfo = host_basic_info_t.allocate(capacity: 1)
Expand Down

0 comments on commit de64f94

Please sign in to comment.