Skip to content

Commit 6a7fabf

Browse files
committed
fix(webapp): show plain loading text while recovery waits, reload button only on final state
1 parent bc0e686 commit 6a7fabf

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

apps/webapp/app/components/StaleAssetRecovery.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,11 @@ const script = `(function () {
158158
});
159159
return;
160160
}
161-
var text = final
162-
? "This page failed to load properly. Please reload."
163-
: "An update is being deployed. This page will reload automatically.";
161+
var text = final ? "This page failed to load properly. Please reload." : "Loading…";
164162
var existing = document.getElementById("stale-asset-overlay-text");
165163
if (existing) {
166164
existing.textContent = text;
165+
if (final) document.getElementById("stale-asset-overlay-button").style.display = "";
167166
return;
168167
}
169168
var overlay = document.createElement("div");
@@ -174,9 +173,11 @@ const script = `(function () {
174173
message.id = "stale-asset-overlay-text";
175174
message.textContent = text;
176175
var button = document.createElement("button");
176+
button.id = "stale-asset-overlay-button";
177177
button.textContent = "Reload";
178178
button.style.cssText =
179-
"border:0;border-radius:4px;padding:7px 18px;background:#6366f1;color:#fff;font:inherit;cursor:pointer";
179+
"border:0;border-radius:4px;padding:7px 18px;background:#6366f1;color:#fff;font:inherit;cursor:pointer" +
180+
(final ? "" : ";display:none");
180181
button.onclick = doReload;
181182
overlay.appendChild(message);
182183
overlay.appendChild(button);

0 commit comments

Comments
 (0)