Move runtime data into config directory

This commit is contained in:
troogs
2026-10-01 18:20:05 +02:00
parent 944eed3eb3
commit 2e182d63a3
13 changed files with 509 additions and 79 deletions
+10 -4
View File
@@ -30,15 +30,21 @@
fetch("/api/settings", { cache: "no-store" })
.then((response) => response.json())
.then((settings) => renderNames(settings.names || []))
.then((settings) => {
const names = settings.names || [];
if (names.length === 0) {
localStorage.setItem("selectedName", "");
window.location.href = "checkout.html";
return;
}
renderNames(names);
})
.catch(() => {
nameList.textContent = "Namen konnten nicht geladen werden.";
});
function renderNames(names) {
const options = names.length > 0 ? names : ["Du weißt, wer ich bin"];
options.forEach((name) => {
names.forEach((name) => {
const card = document.createElement("button");
card.type = "button";
card.className = "name-card";