mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed CPU widget update for intel based Macs (#2024)
This commit is contained in:
@@ -135,12 +135,6 @@ public class RAM: Module {
|
||||
self.portalView.callback(value)
|
||||
self.notificationsView.loadCallback(value)
|
||||
|
||||
if #available(macOS 11.0, *) {
|
||||
guard let blobData = try? JSONEncoder().encode(value) else { return }
|
||||
self.userDefaults?.set(blobData, forKey: "RAM@UsageReader")
|
||||
WidgetCenter.shared.reloadTimelines(ofKind: RAM_entry.kind)
|
||||
}
|
||||
|
||||
let total: Double = value.total == 0 ? 1 : value.total
|
||||
self.menuBar.widgets.filter{ $0.isActive }.forEach { (w: SWidget) in
|
||||
switch w.item {
|
||||
@@ -182,5 +176,11 @@ public class RAM: Module {
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
if #available(macOS 11.0, *) {
|
||||
guard let blobData = try? JSONEncoder().encode(value) else { return }
|
||||
self.userDefaults?.set(blobData, forKey: "RAM@UsageReader")
|
||||
WidgetCenter.shared.reloadTimelines(ofKind: RAM_entry.kind)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user