From 5da58ee030355c3918f35a29ed1c1f2857397846 Mon Sep 17 00:00:00 2001 From: AleksDw Date: Sat, 31 May 2025 13:57:58 +0200 Subject: [PATCH] fix auth.ts --- WebApp/ts/auth.ts | 3 --- WebApp/wwwroot/js/auth.js | 3 --- WebApp/wwwroot/js/eventView.js | 12 ++++++------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/WebApp/ts/auth.ts b/WebApp/ts/auth.ts index 2363c03..9f91e0c 100644 --- a/WebApp/ts/auth.ts +++ b/WebApp/ts/auth.ts @@ -49,9 +49,6 @@ function setupAuthUI(): void { logoutBtn.addEventListener('click', logoutUser); } - // Hide all auth buttons initially until DOM loads - const hiddenBeforeLoad = document.querySelectorAll('.hidden-before-load'); - hiddenBeforeLoad.forEach(el => el.classList.remove('hidden-before-load')); } // Initialize on load diff --git a/WebApp/wwwroot/js/auth.js b/WebApp/wwwroot/js/auth.js index e8be80f..d217220 100644 --- a/WebApp/wwwroot/js/auth.js +++ b/WebApp/wwwroot/js/auth.js @@ -38,9 +38,6 @@ function setupAuthUI() { logoutBtn.classList.toggle('d-none', !isAuthenticated); logoutBtn.addEventListener('click', logoutUser); } - // Hide all auth buttons initially until DOM loads - const hiddenBeforeLoad = document.querySelectorAll('.hidden-before-load'); - hiddenBeforeLoad.forEach(el => el.classList.remove('hidden-before-load')); } // Initialize on load document.addEventListener('DOMContentLoaded', setupAuthUI); diff --git a/WebApp/wwwroot/js/eventView.js b/WebApp/wwwroot/js/eventView.js index d5953cd..3b88e16 100644 --- a/WebApp/wwwroot/js/eventView.js +++ b/WebApp/wwwroot/js/eventView.js @@ -36,11 +36,11 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo } catch (err) { if (container !== null) - container.innerHTML = `

To wydarzenie nie istnieje! Powr�t ->

`; + container.innerHTML = `

To wydarzenie nie istnieje! Powrót ->

`; } if (thisEvent == null) { if (container !== null) - container.innerHTML = `

B��d we wczytywaniu wydarzenia. Powr�t ->

`; + container.innerHTML = `

Błąd we wczytywaniu wydarzenia. Powrót ->

`; } else { const titleText = document.getElementById("titleText"); @@ -56,13 +56,13 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo dateText.innerHTML = "When: " + newdateText + " " + newtimeText; //thisEvent.eventDate; organizerText.innerHTML = "Organized by: " + thisEvent.organisationName; if (org_id == thisEvent.organisationId) { - // U�ytkownik jest organizacj�, kt�ra - // stworzy�a to wydarzenie + // Użytkownik jest organizacją, która + // stworzyła to wydarzenie unhideElementById(document, "editBtn"); unhideElementById(document, "removeBtn"); } else if (org_id == -1) { - // U�ytkownik jest wolontariuszem + // Użytkownik jest wolontariuszem unhideElementById(document, "applyBtn"); } unhideElementById(document, "mainContainer"); @@ -78,7 +78,7 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo if (!confirmed) return; try { - // Wysy�a ��danie DELETE do API + // Wysyła żądanie DELETE do API const response = yield fetch(`/api/events/${eventId}`, { method: "DELETE" });