diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7bbefb3..6f82d3d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,8 +1,9 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; -import { getClientSettings } from "@/lib/clientSettings"; +import { parseClientSettings } from "@/lib/clientSettings"; import { Toaster } from "@/components/ui/sonner"; +import { cookies } from "next/headers"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -33,7 +34,8 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - const settings = getClientSettings(); + const c = await cookies(); + const settings = parseClientSettings(c.get("settings")?.value); return ( diff --git a/src/components/settings/SettingSchema.tsx b/src/components/settings/SettingSchema.tsx index 840c1dc..d28be42 100644 --- a/src/components/settings/SettingSchema.tsx +++ b/src/components/settings/SettingSchema.tsx @@ -58,7 +58,7 @@ export default function SettingSchema({ if (!regexSetting.pattern.test(value)) { setFeedback({ kind: "error", - message: `Value does not match the pattern!`, + message: `Value does not match the pattern`, }); } else { setFeedback(undefined); @@ -124,7 +124,7 @@ export default function SettingSchema({ <> {Object.entries(schema).map(([key, type]) => (
- + {renderInput(key, type)}
))} diff --git a/src/components/settings/SettingsDialog.tsx b/src/components/settings/SettingsDialog.tsx index 12c6789..1e8d452 100644 --- a/src/components/settings/SettingsDialog.tsx +++ b/src/components/settings/SettingsDialog.tsx @@ -45,7 +45,7 @@ export default function SettingsDialog({
- + {profile && }
diff --git a/src/types/settings.ts b/src/types/settings.ts index 1cac9b1..75d02a2 100644 --- a/src/types/settings.ts +++ b/src/types/settings.ts @@ -23,7 +23,7 @@ export const PROFILE_SCHEMA: SettingsSchema = { display_name: "string", avatar_url: "string", node_address: new RegexSetting( - "node2.axiom.org", - /^(?:(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}|(?:\d{1,3}\.){3}\d{1,3})$/ + "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i ), };