Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Complete more of data transfer request creation process
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 7dcbb85 commit d620e04
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions app/routes/data-transfer/start.tsx
Expand Up @@ -7,6 +7,7 @@ import {
RadioGroup,
Text,
Textarea,
useToast,
} from "@chakra-ui/react";
import { useState } from "react";

Expand All @@ -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>
Expand All @@ -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>
);
}

0 comments on commit d620e04

Please sign in to comment.