Brightness: Hiding a couple warnings, does not work at all with 3 monitors
This commit is contained in:
parent
838962e448
commit
8afb71b114
1 changed files with 12 additions and 2 deletions
|
|
@ -208,7 +208,12 @@ Singleton {
|
||||||
|
|
||||||
function getStoredBrightness(): real {
|
function getStoredBrightness(): real {
|
||||||
// Try to get stored brightness for this specific monitor
|
// Try to get stored brightness for this specific monitor
|
||||||
var stored = Settings.data.brightness.monitorBrightness.find(m => m.name === modelData.name)
|
var stored = Settings.data.brightness.monitorBrightness.find(m => {
|
||||||
|
if (m !== null) {
|
||||||
|
return m.name === modelData.name
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
if (stored) {
|
if (stored) {
|
||||||
return stored.brightness / 100
|
return stored.brightness / 100
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +229,12 @@ Singleton {
|
||||||
Settings.data.brightness.lastMethod = method
|
Settings.data.brightness.lastMethod = method
|
||||||
|
|
||||||
// Update monitor-specific brightness
|
// Update monitor-specific brightness
|
||||||
var monitorIndex = Settings.data.brightness.monitorBrightness.findIndex(m => m.name === modelData.name)
|
var monitorIndex = Settings.data.brightness.monitorBrightness.findIndex(m => {
|
||||||
|
if (m !== null) {
|
||||||
|
return m.name === modelData.name
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
})
|
||||||
var monitorData = {
|
var monitorData = {
|
||||||
"name": modelData.name,
|
"name": modelData.name,
|
||||||
"brightness": brightnessPercent,
|
"brightness": brightnessPercent,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue