Complete more of data transfer request creation process
This commit is contained in:
parent
7dcbb85fb1
commit
d620e04e21
@ -7,6 +7,7 @@ import {
|
||||
RadioGroup,
|
||||
Text,
|
||||
Textarea,
|
||||
useToast,
|
||||
} from "@chakra-ui/react";
|
||||
import { useState } from "react";
|
||||
|
||||
@ -15,9 +16,7 @@ export default function () {
|
||||
return (
|
||||
<Container maxW="container.md">
|
||||
<Heading pt="36px">Let's get started</Heading>
|
||||
<Text pt="128px">
|
||||
Are you able to log in to the account you are transferring from?
|
||||
</Text>
|
||||
<Text pt="128px">Is your old Roblox account banned?</Text>
|
||||
<RadioGroup onChange={(val) => setShowCookieBox(JSON.parse(val))}>
|
||||
<HStack>
|
||||
<Radio value="false">No</Radio>
|
||||
@ -28,9 +27,49 @@ export default function () {
|
||||
id="cookie-box"
|
||||
placeholder="Paste your .ROBLOSECURITY cookie here"
|
||||
pt="16px"
|
||||
style={{ display: showCookieBox ? "initial" : "unset" }}
|
||||
style={{ display: showCookieBox ? "initial" : "none" }}
|
||||
/>
|
||||
<Button pt="32px">Continue</Button>
|
||||
<Button
|
||||
onClick={async () => {
|
||||
const createTransferReq = await fetch("/api/data-transfers/create", {
|
||||
body: JSON.stringify({
|
||||
can_access: !showCookieBox,
|
||||
cookie: (
|
||||
document.getElementById("cookie-box") as HTMLInputElement
|
||||
).value,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
if (!createTransferReq.ok) {
|
||||
useToast()({
|
||||
description: (
|
||||
(await createTransferReq.json()) as { error: string }
|
||||
).error,
|
||||
isClosable: true,
|
||||
status: "error",
|
||||
title: "Failed to create transfer request",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
location.assign(
|
||||
((await createTransferReq.json()) as { url: string }).url,
|
||||
);
|
||||
}}
|
||||
pt="32px"
|
||||
>
|
||||
Continue
|
||||
</Button>
|
||||
<br />
|
||||
<Text pt="16px">
|
||||
If you cannot login at all, please visit the support page and join our
|
||||
server.
|
||||
</Text>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user