From 8a020c5c24e0c478fab5c3d46d89585474d46df1 Mon Sep 17 00:00:00 2001 From: HyeokjinKang Date: Tue, 31 Oct 2023 15:23:58 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=8D=94=20=EB=82=98=EC=9D=80=20SSR?= =?UTF-8?q?F=20=EB=B0=A9=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 019ae17..f0520cc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,7 +122,10 @@ const upload = multer({ }).single("img"); app.post("/profile/:userid/:type", async (req, res) => { - if (req.params.type != "picture" && req.params.type != "background") { + let type = ""; + if (req.params.type == "picture") type = "picture"; + else if (req.params.type == "background") type = "background"; + else { res.status(400).json({ result: "failed", message: "Error occured while uploading", @@ -150,7 +153,7 @@ app.post("/profile/:userid/:type", async (req, res) => { }); return; } - fetch(`${config.project.api}/profile/${req.params.type}`, { + fetch(`${config.project.api}/profile/${type}`, { method: "PUT", headers: { "Content-Type": "application/json", From cb003cbe1915a92957d05e90d9d9a08190496fd0 Mon Sep 17 00:00:00 2001 From: HyeokjinKang Date: Tue, 31 Oct 2023 15:25:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EB=B0=B0=EB=84=88=EA=B0=80=20?= =?UTF-8?q?=EB=AA=A8=EB=91=90=20=EA=B0=80=EB=A0=A4=EC=A7=84=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=EC=9D=BC=EB=95=8C=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/game.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/public/js/game.js b/public/js/game.js index afea724..435c245 100644 --- a/public/js/game.js +++ b/public/js/game.js @@ -1295,22 +1295,21 @@ const profileUpdate = async (uid, isMe) => { document.getElementsByClassName("profileStatValue")[3].textContent = profile.playtime; document.getElementsByClassName("profileStatValue")[4].textContent = profile["1stNum"]; banners = JSON.parse(profile.banner); - if (banners.length == 0) { - document.getElementById("profileBanner").innerHTML = `${nothingHere}`; - } else { - document.getElementById("profileBanner").innerHTML = `
`; - for (let i = 0; i < banners.length; i++) { - if (banners[i].indexOf("(-)") != -1 && !isMe) continue; - document.getElementById("profileBannerContainer").innerHTML += ` + document.getElementById("profileBanner").innerHTML = `
`; + let count = 0; + for (let i = 0; i < banners.length; i++) { + if (banners[i].indexOf("(-)") != -1 && !isMe) continue; + count++; + document.getElementById("profileBannerContainer").innerHTML += `
+ isMe ? `onclick="bannerToggle(${i})"` : "" + }>
`; - } } + if (count == 0) document.getElementById("profileBanner").innerHTML = `${nothingHere}`; let recentPlay = JSON.parse(profile.recentPlay); if (recentPlay.length == 0) { document.getElementsByClassName("profileStatValue")[5].textContent = "-";