fix: fixed switching sensor in the settings (#1923)

This commit is contained in:
Serhiy Mytrovtsiy
2024-05-02 17:46:58 +02:00
parent 7ee3d9673e
commit 499a30ff89

View File

@@ -120,10 +120,12 @@ internal class Settings: NSStackView, Settings_v {
}
groups.forEach { (group: SensorGroup) in
filtered.filter{ $0.group == group }.forEach { (s: Sensor_p) in
section.add(PreferencesRow(localizedString(s.name), component: switchView(
let btn = switchView(
action: #selector(self.toggleSensor),
state: s.state
)))
)
btn.identifier = NSUserInterfaceItemIdentifier(rawValue: s.key)
section.add(PreferencesRow(localizedString(s.name), component: btn))
}
}