Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions public/js/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
btn.style.cursor = 'not-allowed';
const btnContent = btn.querySelector('.btn-content');
const btnLoader = btn.querySelector('.btn-loader');
btnContent.style.display = 'none';
btnLoader.style.display = 'inline';
if (btnContent) btnContent.style.display = 'none';
if (btnLoader) btnLoader.style.display = 'inline';

try {
const res = await fetch("/api/auth/login", {
Expand All @@ -59,8 +59,8 @@
btn.textContent = "Sign In";
btn.style.opacity = '1';
btn.style.cursor = 'pointer';
btnContent.style.display = 'flex';
btnLoader.style.display = 'none';
if (btnContent) btnContent.style.display = 'flex';
if (btnLoader) btnLoader.style.display = 'none';
return;
}

Expand All @@ -71,8 +71,8 @@
btn.textContent = "Sign In";
btn.style.opacity = '1';
btn.style.cursor = 'pointer';
btnContent.style.display = 'flex';
btnLoader.style.display = 'none';
if (btnContent) btnContent.style.display = 'flex';
if (btnLoader) btnLoader.style.display = 'none';
}
});
}
Expand Down Expand Up @@ -343,8 +343,8 @@
const btnContent = btn.querySelector('.btn-content');
const btnLoader = btn.querySelector('.btn-loader');

btnContent.style.display = 'none';
btnLoader.style.display = 'inline';
if (btnContent) btnContent.style.display = 'none';
if (btnLoader) btnLoader.style.display = 'inline';

try {
const res = await fetch("/api/auth/register", {
Expand All @@ -360,8 +360,8 @@ btnLoader.style.display = 'inline';
btn.textContent = "Create Account";
btn.style.opacity = '1';
btn.style.cursor = 'pointer';
btnContent.style.display = 'flex';
btnLoader.style.display = 'none';
if (btnContent) btnContent.style.display = 'flex';
if (btnLoader) btnLoader.style.display = 'none';
return;
}

Expand All @@ -372,8 +372,8 @@ btnLoader.style.display = 'inline';
btn.textContent = "Create Account";
btn.style.opacity = '1';
btn.style.cursor = 'pointer';
btnContent.style.display = 'flex';
btnLoader.style.display = 'none';
if (btnContent) btnContent.style.display = 'flex';
if (btnLoader) btnLoader.style.display = 'none';
}
});
}
Expand Down