Ok, this is the problem

This commit is contained in:
ItzLightyHD 2022-07-20 19:25:50 +02:00
parent 5e6c202a3b
commit c99f1e884a
No known key found for this signature in database
GPG Key ID: DEFAE1C838F14470

View File

@ -183,7 +183,6 @@ socket.onopen = () => {
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data);
if(data.message === "PREVIEW_USERNAME_MISSING") {
if(!isLoggedIn) return alphaPreviewNotLoggedInModal.show();
alphaPreviewModal.show();
@ -191,6 +190,10 @@ socket.onmessage = (event) => {
alphaPreviewUsernameModal.hide();
alphaPreviewGeneratedText.textContent = `${alphaPreviewUsername.value}'s preview key has been generated.\nPreview key: ${data.previewKey}`;
alphaPreviewGeneratedModal.show();
} else if (data.message === "USER_PREVIEW_INFO") {
alphaPreviewGeneratedText.textContent = `${data.username}'s preview key is: ${data.previewKey}`;
alphaPreviewGeneratedText.textContent = `You've already generated a preview key. Please use the key below to play the preview.\n\nUsername: ${data.username}\nPreview key: ${data.previewKey}`;
alphaPreviewGeneratedModal.show();
}
};