ask the new version to the new and not old service worker

This commit is contained in:
Bruno Windels 2021-03-24 15:19:10 +01:00
parent 73c433ec3d
commit 2de61c5928

View File

@ -94,7 +94,7 @@ export class ServiceWorkerHandler {
if (document.hidden) { if (document.hidden) {
return; return;
} }
const version = await this._sendAndWaitForReply("version"); const version = await this._sendAndWaitForReply("version", null, this._registration.waiting);
if (confirm(`Version ${version.version} (${version.buildHash}) is available. Reload to apply?`)) { if (confirm(`Version ${version.version} (${version.buildHash}) is available. Reload to apply?`)) {
// prevent any fetch requests from going to the service worker // prevent any fetch requests from going to the service worker
// from any client, so that it is not kept active // from any client, so that it is not kept active