Sign In
Get started now. No credit card required.
@@ -56,14 +56,14 @@ export default async function Page(props: {
By clicking continue, you agree to our{" "}
Terms of Service
{" "}
and{" "}
Privacy Policy
diff --git a/apps/dashboard/src/app/layout.tsx b/apps/dashboard/src/app/layout.tsx
index 2f401012..10aa5900 100644
--- a/apps/dashboard/src/app/layout.tsx
+++ b/apps/dashboard/src/app/layout.tsx
@@ -5,6 +5,7 @@ import { DevelopmentIndicator } from "@/components/development-indicator";
import { TailwindIndicator } from "@/components/tailwind-indicator";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner";
+import { cn } from "@/lib/utils";
import LocalFont from "next/font/local";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import { ogMetadata, twitterMetadata } from "./metadata";
@@ -45,7 +46,12 @@ export default function RootLayout({
return (
"Saved",
- error: "Failed to save",
+ error: (error) => {
+ if (isTRPCClientError(error)) {
+ return error.message;
+ }
+ console.error(error);
+ return "Failed to save";
+ },
});
await promise;
} catch (error) {
diff --git a/apps/dashboard/src/components/forms/onboarding/create-page.tsx b/apps/dashboard/src/components/forms/onboarding/create-page.tsx
index f29c9afb..4f7ac797 100644
--- a/apps/dashboard/src/components/forms/onboarding/create-page.tsx
+++ b/apps/dashboard/src/components/forms/onboarding/create-page.tsx
@@ -11,6 +11,7 @@ import {
FormMessage,
} from "@/components/ui/form";
import { zodResolver } from "@hookform/resolvers/zod";
+import { isTRPCClientError } from "@trpc/client";
import { useTransition } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
@@ -45,7 +46,13 @@ export function CreatePageForm({
toast.promise(promise, {
loading: "Saving...",
success: () => "Saved",
- error: "Failed to save",
+ error: (error) => {
+ if (isTRPCClientError(error)) {
+ return error.message;
+ }
+ console.error(error);
+ return "Failed to save";
+ },
});
await promise;
} catch (error) {