lowercase usernames on the website
The game saves usernames in lowercase, but the search box and the user/board URL parameters were used as typed, so searching "Adam" reported that the user had never played. Lowercase them before use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d78ff7863
commit
7a95e50fe7
4 files changed
+5
-4
No files matched your search
@@ -234,7 +234,7 @@ async function fetchBoard(user, epochDay) {
|
|||||||
|
|
||||||
async function loadBoard() {
|
async function loadBoard() {
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const boardName = params.get("board");
|
const boardName = params.get("board")?.toLowerCase(); // game saves names in lowercase
|
||||||
|
|
||||||
const errorBox = document.getElementById("error");
|
const errorBox = document.getElementById("error");
|
||||||
const dateEl = document.getElementById("date");
|
const dateEl = document.getElementById("date");
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ function formatDateFromEpochDays(epochDays) {
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const user = params.get("user");
|
const user = params.get("user")?.toLowerCase(); // game saves names in lowercase
|
||||||
const usernameSpan = document.getElementById("username");
|
const usernameSpan = document.getElementById("username");
|
||||||
const gamesList = document.getElementById("games-list");
|
const gamesList = document.getElementById("games-list");
|
||||||
const emptyMsg = document.getElementById("empty");
|
const emptyMsg = document.getElementById("empty");
|
||||||
|
|||||||
@@ -109,7 +109,8 @@
|
|||||||
|
|
||||||
form.addEventListener("submit", (e) => {
|
form.addEventListener("submit", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const user = input.value.trim();
|
// The game saves usernames in lowercase
|
||||||
|
const user = input.value.trim().toLowerCase();
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
window.location.href = `/stats.html?user=${encodeURIComponent(user)}`;
|
window.location.href = `/stats.html?user=${encodeURIComponent(user)}`;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
<script>
|
<script>
|
||||||
(async () => {
|
(async () => {
|
||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const user = params.get("user");
|
const user = params.get("user")?.toLowerCase(); // game saves names in lowercase
|
||||||
const output = document.getElementById("output");
|
const output = document.getElementById("output");
|
||||||
const usernameSpan = document.getElementById("username");
|
const usernameSpan = document.getElementById("username");
|
||||||
const gamesLink = document.getElementById("games-link");
|
const gamesLink = document.getElementById("games-link");
|
||||||
|
|||||||
Reference in new issue
Block a user