Simplify error catching

This commit is contained in:
Michael Shamoon 2022-11-07 09:24:15 -08:00
parent 00163d2f44
commit 8a783ba9f6
41 changed files with 93 additions and 113 deletions

View file

@ -12,7 +12,7 @@ export default function Widget({ options }) {
options.type = "unifi_console";
const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites", { index: options.index });
if (statsError || statsData?.error) {
if (statsError) {
return (
<div className="flex flex-col justify-center first:ml-0 ml-4">
<div className="flex flex-row items-center justify-end">