mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix network reader after reconnection to the network
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user