Compare commits

..

No commits in common. "0eef4ed4f68fe6eb9a88309bf066621241feb865" and "9b6c1f07f907fd0b0ebeb8df60f3d4894dc7ef64" have entirely different histories.

@ -83,20 +83,15 @@ export default function CodeDialog({
}); });
async function onSubmit(data: z.infer<typeof FormSchema>) { async function onSubmit(data: z.infer<typeof FormSchema>) {
const { code } = data; const { code } = data;
toast.promise( const playerName = await toast.promise(
new Promise<void>((g, b) => { new Promise(async (g, b) => {
linkMCAccount(code).then((c) => { const response = await linkMCAccount(code);
console.log(c);
if (c === undefined) { if (response == undefined) {
b(); b();
return; return;
} }
g(); g(response);
setName(c);
setDialog(true);
setLinked(true);
});
}), }),
{ {
loading: "Linking account..", loading: "Linking account..",
@ -104,6 +99,9 @@ export default function CodeDialog({
success: "Linked account!", success: "Linked account!",
} }
); );
setName(playerName as string);
setDialog(true);
setLinked(true);
} }
return ( return (
@ -158,9 +156,9 @@ export default function CodeDialog({
<DialogTitle>You have linked your account!</DialogTitle> <DialogTitle>You have linked your account!</DialogTitle>
<Confetti className="absolute left-0 top-0 z-0 size-full" /> <Confetti className="absolute left-0 top-0 z-0 size-full" />
<DialogDescription> <DialogDescription>
You've successfully linked your account, {name}! Enjoy adding You've successfully linked your account, <strong>{name}</strong>!
banners, custom accent colors, and other things to your server Enjoy adding banners, custom accent colors, and other things to
page. your server page.
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
</DialogContent> </DialogContent>