From 8b14e9adfb1fec68d89756d0bd425fd0715c6d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 7 Dec 2024 23:34:35 +0100 Subject: [PATCH] Set ags temp to N/A if it isn't available --- home/ags/files/Bar.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/home/ags/files/Bar.tsx b/home/ags/files/Bar.tsx index 74bcc0a..96f584a 100644 --- a/home/ags/files/Bar.tsx +++ b/home/ags/files/Bar.tsx @@ -80,18 +80,18 @@ function Time({ format = "%H:%M:%S" }): JSX.Element { } function Temp(): JSX.Element { + let label = Variable("N/A"); if (sensorsAvailable) { - const temp = Variable("").poll(5000, 'sensors', out => { + label = Variable("").poll(5000, 'sensors', out => { const match = out.split('\n').find(line => line.includes('Tctl') || line.includes('Package'))?.match(/[0-9.]*°C/); return match ? match[0] : "N/A"; }) - return