Rollback alla 3.0.0 (24391c4)
Ripristinato per intero lo stato del commit 24391c4, che sull'iPhone
con l'icona installata si vedeva correttamente. Le modifiche dei commit
successivi restano nella storia per essere riprese una per volta.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9fecb068b
commit
ffb04a96a7
8 files changed
+12
-188
No files matched your search
@@ -758,7 +758,7 @@
|
||||
'<button type="button" class="btn btn-accent btn-lg offline-btn" id="offlineRetryBtn">' +
|
||||
'<svg class="icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>' +
|
||||
'<span>Riprova</span></button></div>';
|
||||
(document.getElementById('app') || body).appendChild(overlay);
|
||||
body.appendChild(overlay);
|
||||
|
||||
var btn = $('#offlineRetryBtn');
|
||||
btn.addEventListener('click', function () {
|
||||
@@ -786,36 +786,8 @@
|
||||
Avvio
|
||||
===================================================================== */
|
||||
|
||||
/**
|
||||
* Guscio vecchio con script nuovo (un service worker di una versione precedente ha servito l'HTML dalla cache):
|
||||
* si svuotano cache e worker e si ricarica, una volta sola.
|
||||
*/
|
||||
function gusciVecchio() {
|
||||
if (document.getElementById('player-dock')) return false;
|
||||
var chiave = 'rpi-riparazione';
|
||||
try {
|
||||
if (sessionStorage.getItem(chiave)) return true;
|
||||
sessionStorage.setItem(chiave, '1');
|
||||
} catch (e) { /* senza archivio si tenta comunque una volta */ }
|
||||
var pulizia = [];
|
||||
if ('serviceWorker' in navigator) {
|
||||
pulizia.push(navigator.serviceWorker.getRegistrations().then(function (regs) {
|
||||
return Promise.all(regs.map(function (r) { return r.unregister(); }));
|
||||
}));
|
||||
}
|
||||
if ('caches' in window) {
|
||||
pulizia.push(caches.keys().then(function (keys) {
|
||||
return Promise.all(keys.map(function (k) { return caches.delete(k); }));
|
||||
}));
|
||||
}
|
||||
Promise.all(pulizia).catch(function () { /* si ricarica comunque */ }).then(function () {
|
||||
window.location.reload();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
function init() {
|
||||
if (!content || gusciVecchio()) return;
|
||||
if (!content) return;
|
||||
Offline.init();
|
||||
Player.init();
|
||||
Podcast.init();
|
||||
|
||||
Reference in new issue
Block a user