Skip to content

Commit 3ef2cd6

Browse files
authored
Merge pull request #1076 from writer/AB-224
fix(ui): prevent loading message to stay on the page - AB-224
2 parents 583eeb8 + 4f72505 commit 3ef2cd6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ui/src/main.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,18 @@ async function initialise() {
9696
reason,
9797
);
9898
const loaderEl = document.getElementById("loading_L1");
99-
if (loaderEl && !document.getElementById("loading_message") && attempt >= 2) {
99+
if (
100+
loaderEl &&
101+
!document.getElementById("loading_message") &&
102+
attempt >= 2
103+
) {
100104
const message = document.createElement("div");
101105
message.id = "loading_message";
102106
message.textContent =
103107
"We're getting things ready.\nHang tight while we connect...";
104108
message.style.cssText =
105109
"position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);margin-top:120px;text-align:center;font-family: 'Poppins','Helvetica Neue','Lucida Grande',sans-serif;color:#666;font-size:14px;line-height:1.4;max-width:400px;padding:0 20px;z-index:1000;white-space:pre-line;opacity:0;transition:opacity 0.5s ease-in;";
106-
document.body.appendChild(message);
110+
document.getElementById("loading_L1")?.appendChild(message);
107111
// Trigger fade-in animation
108112
setTimeout(() => {
109113
message.style.opacity = "1";
@@ -126,7 +130,7 @@ initialise()
126130
})
127131
.catch((reason) => {
128132
logger.error("Core initialisation failed.", reason);
129-
133+
130134
const errorDiv = document.createElement("div");
131135
errorDiv.className = "error-message";
132136
errorDiv.setAttribute("role", "alert");

0 commit comments

Comments
 (0)