throw error swampw
This commit is contained in:
parent
e84d7720c7
commit
59cc5cd05c
1 changed files with 24 additions and 5 deletions
|
@ -55,7 +55,6 @@
|
||||||
isLoggingIn = true;
|
isLoggingIn = true;
|
||||||
loginMessage = "Türelmed várjuk amíg 3 leakelt adatbázissal egyeztetjük az adataid";
|
loginMessage = "Türelmed várjuk amíg 3 leakelt adatbázissal egyeztetjük az adataid";
|
||||||
|
|
||||||
// Initial delay before API call
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -88,7 +87,6 @@
|
||||||
if (data.type === 'admin') {
|
if (data.type === 'admin') {
|
||||||
isAdmin = true;
|
isAdmin = true;
|
||||||
document.querySelector('main').innerHTML = data.content.html;
|
document.querySelector('main').innerHTML = data.content.html;
|
||||||
// Add event listener for back button after admin panel is loaded
|
|
||||||
const backButton = document.getElementById('backToLogin');
|
const backButton = document.getElementById('backToLogin');
|
||||||
if (backButton) {
|
if (backButton) {
|
||||||
backButton.addEventListener('click', () => {
|
backButton.addEventListener('click', () => {
|
||||||
|
@ -116,9 +114,13 @@
|
||||||
password = '';
|
password = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
loginMessage = "Nem találtuk ezt a felhasználónév és jelszó párt semelyik leakelt adatbázisban";
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Keep spinning on error
|
loginMessage = "Hiba történt a bejelentkezés során. Próbáld újra később.";
|
||||||
|
isLoggingIn = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,9 +243,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if loginMessage}
|
{#if loginMessage}
|
||||||
<div class="login-message">
|
<div class={isLoggingIn ? "login-message" : "login-error"}>
|
||||||
<p>{loginMessage}</p>
|
<p>{loginMessage}</p>
|
||||||
<div class="spinner"></div>
|
{#if isLoggingIn}
|
||||||
|
<div class="spinner"></div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
@ -473,6 +477,21 @@
|
||||||
font-size: clamp(0.85rem, 3.5vw, 0.9rem);
|
font-size: clamp(0.85rem, 3.5vw, 0.9rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-error {
|
||||||
|
background-color: #f8d7da;
|
||||||
|
border: 1px solid #f5c6cb;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: clamp(0.8rem, 3vw, 1rem);
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
font-size: clamp(0.85rem, 3.5vw, 0.9rem);
|
||||||
|
color: #e74c3c;
|
||||||
|
}
|
||||||
|
|
||||||
.spinner {
|
.spinner {
|
||||||
width: clamp(30px, 8vw, 40px);
|
width: clamp(30px, 8vw, 40px);
|
||||||
height: clamp(30px, 8vw, 40px);
|
height: clamp(30px, 8vw, 40px);
|
||||||
|
|
Loading…
Add table
Reference in a new issue