✨ Closes #234
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user