mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Fix: Improve error handling for Glances widgets when host is unreachable (#3657)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
export default function Container({ children, chart = true, className = "" }) {
|
||||
import { useContext } from "react";
|
||||
|
||||
import Error from "./error";
|
||||
|
||||
import { SettingsContext } from "utils/contexts/settings";
|
||||
|
||||
export default function Container({ children, widget, error = null, chart = true, className = "" }) {
|
||||
const { settings } = useContext(SettingsContext);
|
||||
const hideErrors = settings.hideErrors || widget?.hideErrors;
|
||||
|
||||
if (error) {
|
||||
if (hideErrors) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Error />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user