mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-04 03:42:26 +00:00
Remove spinner from login-required zap notification
This commit is contained in:
1 parent
0a876314c1
commit
bfcef3c5d7
2 files changed
+26
-6
No files matched your search
@@ -7402,6 +7402,29 @@ class Application {
|
||||
return;
|
||||
}
|
||||
|
||||
const { autoHideMs, showSpinner } =
|
||||
options && typeof options === "object" ? options : Object.create(null);
|
||||
|
||||
const shouldShowSpinner = showSpinner !== false;
|
||||
const existingSpinner = container.querySelector(".status-spinner");
|
||||
|
||||
if (shouldShowSpinner) {
|
||||
if (!(existingSpinner instanceof HTMLElementCtor)) {
|
||||
const spinner = ownerDocument?.createElement?.("span") || null;
|
||||
if (spinner) {
|
||||
spinner.className = "status-spinner";
|
||||
spinner.setAttribute("aria-hidden", "true");
|
||||
if (messageTarget && container.contains(messageTarget)) {
|
||||
container.insertBefore(spinner, messageTarget);
|
||||
} else {
|
||||
container.insertBefore(spinner, container.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (existingSpinner instanceof HTMLElementCtor) {
|
||||
existingSpinner.remove();
|
||||
}
|
||||
|
||||
if (!msg) {
|
||||
if (messageTarget && messageTarget instanceof HTMLElementCtor) {
|
||||
messageTarget.textContent = "";
|
||||
@@ -7411,9 +7434,6 @@ class Application {
|
||||
return;
|
||||
}
|
||||
|
||||
const { autoHideMs } =
|
||||
options && typeof options === "object" ? options : Object.create(null);
|
||||
|
||||
if (messageTarget && messageTarget instanceof HTMLElementCtor) {
|
||||
messageTarget.textContent = msg;
|
||||
} else {
|
||||
|
||||
@@ -38,12 +38,12 @@ function isNotificationBannerActive({
|
||||
return text === expectedText;
|
||||
}
|
||||
|
||||
function attemptStatusBanner(app, { autoHideMs, expectedText }) {
|
||||
function attemptStatusBanner(app, { autoHideMs, expectedText, showSpinner }) {
|
||||
if (!app || typeof app.showStatus !== "function") {
|
||||
return false;
|
||||
}
|
||||
|
||||
app.showStatus(expectedText, { autoHideMs });
|
||||
app.showStatus(expectedText, { autoHideMs, showSpinner });
|
||||
|
||||
return isNotificationBannerActive({
|
||||
container: app.statusContainer,
|
||||
@@ -286,7 +286,7 @@ export function showLoginRequiredToZapNotification({
|
||||
getOwnerDocument(app?.statusContainer) ||
|
||||
getOwnerDocument(app?.errorContainer);
|
||||
|
||||
if (attemptStatusBanner(app, { autoHideMs, expectedText })) {
|
||||
if (attemptStatusBanner(app, { autoHideMs, expectedText, showSpinner: false })) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user