mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 16:44:59 -05:00
fix: linking is broken
This commit is contained in:
commit
0eef4ed4f6
@ -83,15 +83,20 @@ 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;
|
||||||
const playerName = await toast.promise(
|
toast.promise(
|
||||||
new Promise(async (g, b) => {
|
new Promise<void>((g, b) => {
|
||||||
const response = await linkMCAccount(code);
|
linkMCAccount(code).then((c) => {
|
||||||
|
console.log(c);
|
||||||
|
if (c === undefined) {
|
||||||
|
b();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
g();
|
||||||
|
|
||||||
if (response == undefined) {
|
setName(c);
|
||||||
b();
|
setDialog(true);
|
||||||
return;
|
setLinked(true);
|
||||||
}
|
});
|
||||||
g(response);
|
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
loading: "Linking account..",
|
loading: "Linking account..",
|
||||||
@ -99,9 +104,6 @@ export default function CodeDialog({
|
|||||||
success: "Linked account!",
|
success: "Linked account!",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
setName(playerName as string);
|
|
||||||
setDialog(true);
|
|
||||||
setLinked(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -156,9 +158,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, <strong>{name}</strong>!
|
You've successfully linked your account, {name}! Enjoy adding
|
||||||
Enjoy adding banners, custom accent colors, and other things to
|
banners, custom accent colors, and other things to your server
|
||||||
your server page.
|
page.
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user