[typo] cpuTemp bad declaration (#151)

As the variable cpuTemp can now be used later in the if block for the fallback, need to change the declaration so that the variable is unique and used in two different blocks.

Const will redeclare it.. My bad on this
This commit is contained in:
Alexandre C. 2025-06-24 04:47:29 +02:00 committed by GitHub
parent 113134d61d
commit 9c0223da60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -160,10 +160,10 @@ Singleton {
})
stdout: StdioCollector {
onStreamFinished: {
const cpuTemp = text.match(/(?:Package id [0-9]+|Tdie):\s+((\+|-)[0-9.]+)(°| )C/);
let cpuTemp = text.match(/(?:Package id [0-9]+|Tdie):\s+((\+|-)[0-9.]+)(°| )C/);
if (!cpuTemp) {
// If AMD Tdie pattern failed, try fallback on Tctl
const cpuTemp = text.match(/Tctl:\s+((\+|-)[0-9.]+)(°| )C/);
cpuTemp = text.match(/Tctl:\s+((\+|-)[0-9.]+)(°| )C/);
}
if (cpuTemp)
root.cpuTemp = parseFloat(cpuTemp[1]);