Skip to content

Commit 0ba4182

Browse files
authored
minor bug fixes (#110)
1 parent 30ae419 commit 0ba4182

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/components/nat.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { useTranslation } from "react-i18next"
2929
import { toast } from "sonner"
3030
import { KeyedMutator } from "swr"
3131
import { z } from "zod"
32+
3233
import { Checkbox } from "./ui/checkbox"
3334
import { Label } from "./ui/label"
3435

@@ -163,9 +164,7 @@ export const NATCard: React.FC<NATCardProps> = ({ data, mutate }) => {
163164
checked={field.value}
164165
onCheckedChange={field.onChange}
165166
/>
166-
<Label className="text-sm">
167-
{t("Enable")}
168-
</Label>
167+
<Label className="text-sm">{t("Enable")}</Label>
169168
</div>
170169
</FormControl>
171170
<FormMessage />

src/hooks/useNotfication.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const NotificationProvider: React.FC<NotificationProviderProps> = ({
4444
if (withNotifier)
4545
(async () => {
4646
try {
47-
const n = await getNotification()
47+
const n = (await getNotification()) || []
4848
const nData = n.map(({ id, name }) => ({ id, name }))
4949
setNotifier(nData)
5050
} catch (error: any) {

src/hooks/useServer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const ServerProvider: React.FC<ServerProviderProps> = ({
4444
if (withServer)
4545
(async () => {
4646
try {
47-
const s = await getServers()
47+
const s = (await getServers()) || []
4848
const serverData = s.map(({ id, name }) => ({ id, name }))
4949
setServer(serverData)
5050
} catch (error: any) {

0 commit comments

Comments
 (0)