mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 13:09:31 +01:00
prefer my code
This commit is contained in:
parent
6fb479deec
commit
694800da9f
@ -10,11 +10,20 @@ const MAX_ALLOWED_FIELDS = 4;
|
|||||||
export default function Component({ service }) {
|
export default function Component({ service }) {
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { data: response, error: responseError } = useWidgetAPI(widget, "statistics");
|
|
||||||
|
|
||||||
if (responseError) {
|
const { data: response, error: responseError } = useWidgetAPI(widget, "statistics");
|
||||||
return <Container service={service} error={responseError} />;
|
|
||||||
}
|
if (responseError) {
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="Error" value={responseError.message} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (responseError) {
|
||||||
|
return <Container service={service} error={responseError} />;
|
||||||
|
}
|
||||||
|
|
||||||
if (!widget.fields?.length > 0) {
|
if (!widget.fields?.length > 0) {
|
||||||
widget.fields = ROMM_DEFAULT_FIELDS;
|
widget.fields = ROMM_DEFAULT_FIELDS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user