Skip to content

Commit 784a3a0

Browse files
committed
update error messages
1 parent 94cc7d6 commit 784a3a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

frontend/src/components/dashboard/base-items/widgets/SystemMonitorWidget/SystemMonitorWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const SystemMonitorWidget = ({ config }: SystemMonitorWidgetProps) => {
3939
});
4040
const [openSystemModal, setOpenSystemModal] = useState(false);
4141
const [isFahrenheit, setIsFahrenheit] = useState(config?.temperatureUnit !== 'celsius');
42-
const [errorMessage, setErrorMessage] = useState<string | null>('null');
42+
const [errorMessage, setErrorMessage] = useState<string | null>(null);
4343
const [isLoading, setIsLoading] = useState(false);
4444

4545
// Default gauges if not specified in config
@@ -442,7 +442,7 @@ export const SystemMonitorWidget = ({ config }: SystemMonitorWidgetProps) => {
442442
p: 2
443443
}}>
444444
<Typography variant='subtitle1' align='center' sx={{ mb: 1 }}>
445-
{errorMessage}
445+
{!errorMessage || errorMessage === 'null' ? 'Error fetching system data' : errorMessage}
446446
</Typography>
447447
<Button
448448
variant='contained'

frontend/src/components/dashboard/base-items/widgets/WeatherWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ export const WeatherWidget: React.FC<WeatherWidgetProps> = ({ config }) => {
316316
p: 2
317317
}}>
318318
<Typography variant='subtitle1' align='center' sx={{ mb: 1 }}>
319-
{errorMessage}
319+
{!errorMessage || errorMessage === 'null' ? 'Error fetching weather data' : errorMessage}
320320
</Typography>
321321
<Button
322322
variant='contained'

0 commit comments

Comments
 (0)