mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Simplify error catching
This commit is contained in:
@@ -15,9 +15,8 @@ export default function Component({ service }) {
|
||||
|
||||
const { data: clusterData, error: clusterError } = useWidgetAPI(widget, "cluster/resources");
|
||||
|
||||
if (clusterError || clusterData?.error) {
|
||||
const finalError = clusterError ?? clusterData.error;
|
||||
return <Container error={finalError} />;
|
||||
if (clusterError) {
|
||||
return <Container error={clusterError} />;
|
||||
}
|
||||
|
||||
if (!clusterData || !clusterData.data) {
|
||||
|
||||
Reference in New Issue
Block a user