From 9c0223da60dac83fc8d0d9dc17b332882c986eb1 Mon Sep 17 00:00:00 2001 From: "Alexandre C." Date: Tue, 24 Jun 2025 04:47:29 +0200 Subject: [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 --- services/SystemUsage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml index d015d2f..7cdcace 100644 --- a/services/SystemUsage.qml +++ b/services/SystemUsage.qml @@ -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]); -- cgit v1.2.3-freya