This commit is contained in:
Mawoka
2023-06-17 17:30:39 +02:00
parent 718041fa34
commit da30beffc2
+10
View File
@@ -33,6 +33,7 @@
onMount(() => { onMount(() => {
if (browser) { if (browser) {
prefetch_username();
hcaptcha = window.hcaptcha; hcaptcha = window.hcaptcha;
if (hcaptcha.render) { if (hcaptcha.render) {
hcaptchaWidgetID = hcaptcha.render('hcaptcha', { hcaptchaWidgetID = hcaptcha.render('hcaptcha', {
@@ -54,6 +55,15 @@
} }
}); });
const prefetch_username = async () => {
const res = await fetch('/api/v1/users/me');
if (res.status !== 200) {
return;
}
const json = await res.json();
username = json.username;
};
const set_game_pin = async () => { const set_game_pin = async () => {
let process_var; let process_var;
try { try {