mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-23 16:41:22 +01:00
Fix registration finish modal not displaying (#1985)
This commit is contained in:
parent
7b45d6c3a5
commit
f62feae6a6
@ -185,6 +185,7 @@
|
||||
|
||||
<script id="mainScript">
|
||||
const errorElement = document.getElementById("fail-msg");
|
||||
let finalizeModal;
|
||||
|
||||
function displayError(message) {
|
||||
errorElement.innerText = message;
|
||||
@ -194,9 +195,11 @@
|
||||
function checkIfRegistered(code) {
|
||||
jsonRequest(`./auth/register?code=${encodeURIComponent(code)}`, (json, error) => {
|
||||
if (error) {
|
||||
finalizeModal.hide();
|
||||
displayError('Checking registration status failed: ' + error)
|
||||
}
|
||||
if (json && json.success) {
|
||||
finalizeModal.hide();
|
||||
window.location.href = "./login";
|
||||
} else {
|
||||
setTimeout(() => checkIfRegistered(code), 5000);
|
||||
@ -223,7 +226,8 @@
|
||||
}
|
||||
const code = json.code;
|
||||
$('.register-code').text(code);
|
||||
$('#finalizeModal').modal();
|
||||
finalizeModal = new bootstrap.Modal(document.getElementById("finalizeModal"));
|
||||
finalizeModal.show();
|
||||
setTimeout(() => checkIfRegistered(code), 10000);
|
||||
});
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user