chore: notify user the config coming from the database is in the wrong format

This commit is contained in:
Miodec 2024-07-27 16:39:35 +02:00
parent c1afd13362
commit f4bfe27175

View file

@ -109,6 +109,12 @@ export async function initSnapshot(): Promise<
};
}
if (configData !== null && !("config" in configData)) {
throw new Error(
"Config data is not in the correct format. Please refresh the page or contact support."
);
}
snap.name = userData.name;
snap.personalBests = userData.personalBests;
snap.personalBests ??= {