mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
fetcing user data first
This commit is contained in:
parent
5005b9aad6
commit
91ea52bec6
1 changed files with 9 additions and 7 deletions
|
|
@ -46,13 +46,15 @@ export async function initSnapshot(): Promise<
|
|||
// LoadingPage.updateBar(16);
|
||||
// }
|
||||
// LoadingPage.updateText("Downloading user...");
|
||||
const [userResponse, configResponse, tagsResponse, presetsResponse] =
|
||||
await Promise.all([
|
||||
Ape.users.getData(),
|
||||
Ape.configs.get(),
|
||||
Ape.users.getTags(),
|
||||
Ape.presets.get(),
|
||||
]);
|
||||
|
||||
//getData recreates the user if it doesnt exist - thats why it needs to be called first, by itself
|
||||
const userResponse = await Ape.users.getData();
|
||||
|
||||
const [configResponse, tagsResponse, presetsResponse] = await Promise.all([
|
||||
Ape.configs.get(),
|
||||
Ape.users.getTags(),
|
||||
Ape.presets.get(),
|
||||
]);
|
||||
|
||||
if (userResponse.status !== 200) {
|
||||
throw {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue