Compare commits

..

No commits in common. "a27df62bf32e366516c1eb4eb20042db622c7e21" and "58eba94628cb6e67e7035e3633b79223711128aa" have entirely different histories.

3 changed files with 3 additions and 13 deletions

View File

@ -417,11 +417,7 @@ class OverviewManager {
'/core/backup-card/js/backup-app-card.js',
];
const load = (url) => (window.spaClean && window.spaClean.loadScript) ? window.spaClean.loadScript(url) : Promise.resolve();
const chain = scripts.reduce((p, url) => p.then(() => load(url)), Promise.resolve());
// Don't memoize a rejection — a transient script-load failure would otherwise
// brick the backup center for the whole session. Clear the memo on failure so
// the next open retries.
this._backupAssets = chain.catch((e) => { this._backupAssets = null; throw e; });
this._backupAssets = scripts.reduce((p, url) => p.then(() => load(url)), Promise.resolve());
return this._backupAssets;
}

View File

@ -79,11 +79,7 @@ class BackupPage {
match: (d) => ['backup', 'restore', 'delete', 'delete_all'].includes(d.action)
|| /^libreportal\s+(backup|restore)\b/.test((d.task && d.task.command) || ''),
run: () => {
// Works whether this is the standalone page (window.backupPage) or
// the instance embedded in the Overview Backups tab
// (window.overviewBackupPage) — the hard-coded global alone would
// make the embedded center's auto-refresh dead.
if ((window.backupPage === this || window.overviewBackupPage === this) && document.getElementById('backup-page')) {
if (window.backupPage === this && document.getElementById('backup-page')) {
return this.refreshAll().then(() => this.render());
}
},

View File

@ -544,9 +544,7 @@ class LibrePortalSPAClean {
script.src = src;
script.id = scriptId;
script.onload = resolve;
// Remove the element on failure so the getElementById() dedupe above can't
// make a later retry resolve instantly without re-fetching.
script.onerror = (e) => { try { script.remove(); } catch (_) {} reject(e); };
script.onerror = reject;
document.head.appendChild(script);
});
}