Compare commits
No commits in common. "a27df62bf32e366516c1eb4eb20042db622c7e21" and "58eba94628cb6e67e7035e3633b79223711128aa" have entirely different histories.
a27df62bf3
...
58eba94628
@ -417,11 +417,7 @@ class OverviewManager {
|
|||||||
'/core/backup-card/js/backup-app-card.js',
|
'/core/backup-card/js/backup-app-card.js',
|
||||||
];
|
];
|
||||||
const load = (url) => (window.spaClean && window.spaClean.loadScript) ? window.spaClean.loadScript(url) : Promise.resolve();
|
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());
|
this._backupAssets = 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; });
|
|
||||||
return this._backupAssets;
|
return this._backupAssets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,11 +79,7 @@ class BackupPage {
|
|||||||
match: (d) => ['backup', 'restore', 'delete', 'delete_all'].includes(d.action)
|
match: (d) => ['backup', 'restore', 'delete', 'delete_all'].includes(d.action)
|
||||||
|| /^libreportal\s+(backup|restore)\b/.test((d.task && d.task.command) || ''),
|
|| /^libreportal\s+(backup|restore)\b/.test((d.task && d.task.command) || ''),
|
||||||
run: () => {
|
run: () => {
|
||||||
// Works whether this is the standalone page (window.backupPage) or
|
if (window.backupPage === this && document.getElementById('backup-page')) {
|
||||||
// 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')) {
|
|
||||||
return this.refreshAll().then(() => this.render());
|
return this.refreshAll().then(() => this.render());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -544,9 +544,7 @@ class LibrePortalSPAClean {
|
|||||||
script.src = src;
|
script.src = src;
|
||||||
script.id = scriptId;
|
script.id = scriptId;
|
||||||
script.onload = resolve;
|
script.onload = resolve;
|
||||||
// Remove the element on failure so the getElementById() dedupe above can't
|
script.onerror = reject;
|
||||||
// make a later retry resolve instantly without re-fetching.
|
|
||||||
script.onerror = (e) => { try { script.remove(); } catch (_) {} reject(e); };
|
|
||||||
document.head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user