Fix bad logic on dialog

This commit is contained in:
Holly Stubbs 2024-04-19 11:46:36 +01:00
parent 6da93efb10
commit e92e6a8cac
Signed by: tgpholly
GPG Key ID: B8583C4B7D18119E
1 changed files with 2 additions and 1 deletions

View File

@ -343,7 +343,7 @@ if (!window.TE_ACTIVE) {
buttons.style.marginTop = "1rem"; buttons.style.marginTop = "1rem";
dialog.appendChild(buttons); dialog.appendChild(buttons);
const submitButton = document.createElement("button"); const submitButton = document.createElement("button");
submitButton.innerText = localStorage["t00mp_username"] !== "" ? "Connect" : "Change Username"; submitButton.innerText = (localStorage["t00mp_username"] && localStorage["t00mp_username"] === "") ? "Connect" : "Change Username";
submitButton.onclick = () => submitFunction(null); submitButton.onclick = () => submitFunction(null);
buttons.appendChild(submitButton); buttons.appendChild(submitButton);
if (localStorage["t00mp_username"] !== "") { if (localStorage["t00mp_username"] !== "") {
@ -354,6 +354,7 @@ if (!window.TE_ACTIVE) {
bg.remove(); bg.remove();
window.location.href = window.location.href; window.location.href = window.location.href;
} }
buttons.appendChild(disconnectButton);
} }
const doNotButton = document.createElement("button"); const doNotButton = document.createElement("button");
doNotButton.innerText = "Close"; doNotButton.innerText = "Close";