🔨」 fix: fixed some things.

This commit is contained in:
2025-10-24 15:38:55 +02:00
parent 7ab278c1af
commit 540c94a272
9 changed files with 21 additions and 21 deletions

View File

@ -170,5 +170,5 @@ async function startMenuPP() {
}
}
setInterval(startMenuPP, 3000);
setInterval(startMenuPP, 5000);
startMenuPP();

View File

@ -93,7 +93,7 @@ export default class extends Aview {
// throw new Error("invalid response");
}
} catch (error) {
console.error(error);
console.log(error);
}
}
@ -186,7 +186,7 @@ export default class extends Aview {
}
catch (error)
{
console.error(error);
console.log(error);
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
document.getElementById("login-error-message").classList.remove("hidden");
}

View File

@ -54,7 +54,7 @@ export default class extends Aview {
credentials: "include",
});
if (userdata_req.status == 404) {
console.error("invalid user");
console.log("invalid user");
return;
}
let userdata = await userdata_req.json();
@ -74,7 +74,7 @@ export default class extends Aview {
let main = document.getElementById("profile-pong-scorelist");
if (!main)
return console.error("what");
return console.log("what");
if (matches.matchHistory) {
for (let match of matches.matchHistory) {
@ -136,7 +136,7 @@ export default class extends Aview {
main = document.getElementById("profile-tetris-scorelist");
if (!main)
return console.error("what");
return console.log("what");
// don't read this shit for you mental health
if (matches.matchHistory) {

View File

@ -54,7 +54,7 @@ export default class extends Aview {
});
if (userdata_req.status == 404)
{
console.error("invalid user");
console.log("invalid user");
return ;
}
let userdata = await userdata_req.json();
@ -69,7 +69,7 @@ export default class extends Aview {
document.getElementById("profile-items").innerHTML = await getMainHTML();
requestAnimationFrame(() => {
document.getElementById("menu-logout").addEventListener("click", async () => {
document.getElementById("menu-logout")?.addEventListener("click", async () => {
let req = fetch(`${auth_api}/logout`, {
method: "GET",
credentials: "include",
@ -79,7 +79,7 @@ export default class extends Aview {
if (res.status === 200)
this.run();
else
console.error("logout failed");
console.log("logout failed");
});
});
});

View File

@ -91,7 +91,7 @@ export default class extends Aview {
}
catch (error) {
console.error(error);
console.log(error);
if (document.getElementById("login-error-message")) {
document.getElementById("login-error-message").innerHTML = "error: server error, try again later...";
document.getElementById("login-error-message")?.classList.remove("hidden");

View File

@ -74,7 +74,7 @@ export default class extends Aview {
credentials: "include",
});
if (userdata_req.status == 404) {
console.error("invalid user");
console.log("invalid user");
return;
}
let userdata = await userdata_req.json();
@ -106,16 +106,16 @@ export default class extends Aview {
if (delete_req.status == 200)
navigationManager("/");
else
console.error("xd"); // xd?????????????
console.log("xd"); // xd?????????????
});
const upload = document.getElementById("upload-file") as HTMLInputElement;
upload.addEventListener("change", () => {
const fileList: FileList | null = upload.files;
if (!fileList)
return console.error("empty");
return console.log("empty");
if (!fileList[0].type.startsWith("image/")) {
console.error("invalid file");
console.log("invalid file");
return;
}

View File

@ -307,18 +307,18 @@ export default class extends Aview {
) as HTMLCanvasElement | null;
this.canvas = el;
if (!this.canvas)
throw console.error("no canvas :c");
throw console.log("no canvas :c");
this.canvas.width = COLS * BLOCK;
this.canvas.height = ROWS * BLOCK;
const ctx = this.canvas.getContext("2d");
this.ctx = ctx;
if (!this.ctx)
throw console.error("no ctx D:");
throw console.log("no ctx D:");
this.holdCanvas = document.getElementById("hold") as HTMLCanvasElement;
this.queueCanvas = document.getElementById("queue") as HTMLCanvasElement;
if (!this.holdCanvas || !this.queueCanvas)
throw console.error("no canvas :c");
throw console.log("no canvas :c");
this.holdCtx = this.holdCanvas.getContext("2d");
this.queueCtx = this.queueCanvas.getContext("2d");
if (!this.holdCtx || !this.queueCtx)

View File

@ -332,18 +332,18 @@ export default class extends Aview {
) as HTMLCanvasElement | null;
this.canvas = el;
if (!this.canvas)
throw console.error("no canvas :c");
throw console.log("no canvas :c");
this.canvas.width = COLS * BLOCK;
this.canvas.height = ROWS * BLOCK;
const ctx = this.canvas.getContext("2d");
this.ctx = ctx;
if (!this.ctx)
throw console.error("no ctx D:");
throw console.log("no ctx D:");
this.holdCanvas = document.getElementById(canvasId + "-hold") as HTMLCanvasElement;
this.queueCanvas = document.getElementById(canvasId + "-queue") as HTMLCanvasElement;
if (!this.holdCanvas || !this.queueCanvas)
throw console.error("no canvas :c");
throw console.log("no canvas :c");
this.holdCtx = this.holdCanvas.getContext("2d");
this.queueCtx = this.queueCanvas.getContext("2d");
if (!this.holdCtx || !this.queueCtx)

View File

@ -77,6 +77,6 @@ async function start() {
}
start().catch((err) => {
console.error(err);
console.log(err);
process.exit(1);
});