Save hashed PW. Simplify model update. Bugfixes & improvements. Working user-settings & games.

This commit is contained in:
MaxJa4
2024-01-18 19:00:32 +01:00
parent f8ac93f163
commit f2ab72ba1e
20 changed files with 310 additions and 113 deletions

View File

@@ -37,7 +37,7 @@
const submitButton = addPlayerModal.querySelector('button[name="submit"]');
const playerName = addPlayerModal.querySelector('#playerName');
const clanName = addPlayerModal.querySelector('#playerClanName');
const errorDiv = editPlayerModal.querySelector('.error-message');
const errorDiv = addPlayerModal.querySelector('.error-message');
const homeClanListIndex = document.getElementById('home-clan').selectedIndex;
const oppClanListIndex = document.getElementById('opponent-clan').selectedIndex;
@@ -67,6 +67,12 @@
"Content-type": "application/json; charset=UTF-8"
}
})
.then(response => {
if (!response.ok) {
throw new Error('Hinzufügen fehlgeschlagen!\nSpielername existiert möglichweise bereits.');
}
return response.text();
})
.then(() => {
const sameClan = homeClanListIndex === oppClanListIndex;
if (playerList.id === 'home-player-list' || sameClan)