toast fix
This commit is contained in:
@@ -29,7 +29,8 @@ export default function Signup() {
|
||||
};
|
||||
|
||||
const signUp: SubmitHandler<FormValues> = async (data) => {
|
||||
const res = await toast.promise(
|
||||
const res = await toast
|
||||
.promise(
|
||||
fetch("/api/auth/signup", {
|
||||
body: JSON.stringify({
|
||||
...data,
|
||||
@@ -45,11 +46,6 @@ export default function Signup() {
|
||||
...data,
|
||||
callbackUrl: "https://app.documenso.com/dashboard",
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
methods.setError("apiError", { message: err.message });
|
||||
// Throw again for toast
|
||||
throw new Error(err.message);
|
||||
}),
|
||||
{
|
||||
loading: "Creating your account...",
|
||||
@@ -61,7 +57,11 @@ export default function Signup() {
|
||||
minWidth: "200px",
|
||||
},
|
||||
}
|
||||
);
|
||||
)
|
||||
.catch((err) => {
|
||||
toast.dismiss();
|
||||
methods.setError("apiError", { message: err.message });
|
||||
});
|
||||
};
|
||||
|
||||
function renderApiError() {
|
||||
|
||||
Reference in New Issue
Block a user