diff --git a/src/components/nat.tsx b/src/components/nat.tsx index 2adeefc..f82677f 100644 --- a/src/components/nat.tsx +++ b/src/components/nat.tsx @@ -29,6 +29,7 @@ import { useTranslation } from "react-i18next" import { toast } from "sonner" import { KeyedMutator } from "swr" import { z } from "zod" + import { Checkbox } from "./ui/checkbox" import { Label } from "./ui/label" @@ -163,9 +164,7 @@ export const NATCard: React.FC = ({ data, mutate }) => { checked={field.value} onCheckedChange={field.onChange} /> - + diff --git a/src/hooks/useNotfication.tsx b/src/hooks/useNotfication.tsx index c98e6f9..855a322 100644 --- a/src/hooks/useNotfication.tsx +++ b/src/hooks/useNotfication.tsx @@ -44,7 +44,7 @@ export const NotificationProvider: React.FC = ({ if (withNotifier) (async () => { try { - const n = await getNotification() + const n = (await getNotification()) || [] const nData = n.map(({ id, name }) => ({ id, name })) setNotifier(nData) } catch (error: any) { diff --git a/src/hooks/useServer.tsx b/src/hooks/useServer.tsx index 46861b3..2942526 100644 --- a/src/hooks/useServer.tsx +++ b/src/hooks/useServer.tsx @@ -44,7 +44,7 @@ export const ServerProvider: React.FC = ({ if (withServer) (async () => { try { - const s = await getServers() + const s = (await getServers()) || [] const serverData = s.map(({ id, name }) => ({ id, name })) setServer(serverData) } catch (error: any) {