Delay consent checkbox hiding until successful auth
This commit is contained in:
@@ -52,10 +52,6 @@ function setupHandlers() {
|
|||||||
const box = $(id);
|
const box = $(id);
|
||||||
if (box) {
|
if (box) {
|
||||||
box.checked = hasConsent();
|
box.checked = hasConsent();
|
||||||
box.addEventListener("change", () => {
|
|
||||||
if (box.checked) setConsent();
|
|
||||||
toggleConsentRows();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -99,6 +95,7 @@ function setupHandlers() {
|
|||||||
try {
|
try {
|
||||||
await api.login({ username, password });
|
await api.login({ username, password });
|
||||||
setConsent();
|
setConsent();
|
||||||
|
toggleConsentRows();
|
||||||
setSavedUsername(username);
|
setSavedUsername(username);
|
||||||
state.isAuthenticated = true;
|
state.isAuthenticated = true;
|
||||||
setAuthUI(true);
|
setAuthUI(true);
|
||||||
@@ -127,6 +124,7 @@ function setupHandlers() {
|
|||||||
try {
|
try {
|
||||||
await api.register({ username, password, displayName, adminKey });
|
await api.register({ username, password, displayName, adminKey });
|
||||||
setConsent();
|
setConsent();
|
||||||
|
toggleConsentRows();
|
||||||
setSavedUsername(username);
|
setSavedUsername(username);
|
||||||
state.isAuthenticated = true;
|
state.isAuthenticated = true;
|
||||||
setAuthUI(true);
|
setAuthUI(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user