From 0b48ab75bf95516992c6dac021ff2787245d6bd9 Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Wed, 7 Aug 2024 14:46:49 +0530 Subject: [PATCH 1/6] chore: add close button --- src/app/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3e899f6a1..e01bc350e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -42,7 +42,7 @@ export default async function RootLayout({
{children}
- + {nodeEnv === "development" && }
From 3fe751a566ec114136fa6970d2e0b7313984100e Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Wed, 7 Aug 2024 14:47:01 +0530 Subject: [PATCH 2/6] fix: flickering --- .../components/create-access-token.tsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/settings/developer/components/create-access-token.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/settings/developer/components/create-access-token.tsx index e2837997a..3788d2286 100644 --- a/src/app/(authenticated)/(dashboard)/[publicId]/settings/developer/components/create-access-token.tsx +++ b/src/app/(authenticated)/(dashboard)/[publicId]/settings/developer/components/create-access-token.tsx @@ -21,9 +21,14 @@ const CreateAccessToken = () => { const createMutation = api.accessToken.create.useMutation({ onSuccess: ({ token }) => { setAccessToken(token); - copy(token); - toast.success("Access token copied to clipboard."); + + toast.promise(copy(token), { + loading: "copying token...", + success: "Access token copied to clipboard.", + error: "error copying token", + }); setOpen(true); + setLoading(false); }, onError: (error) => { @@ -33,17 +38,15 @@ const CreateAccessToken = () => { onSettled: () => { setLoading(false); - router.refresh(); }, }); return (