From cf12edb86124d6535c8d548cd18803fb319acbb8 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Tue, 19 May 2020 18:59:03 +0800 Subject: [PATCH] Use IE11-compatible code for worker deregistration. (#5079) Fixes #5078. --- modules/backend/layouts/_head.htm | 6 +++--- modules/backend/layouts/auth.htm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/backend/layouts/_head.htm b/modules/backend/layouts/_head.htm index d4b2518b8..6b0bb19f5 100644 --- a/modules/backend/layouts/_head.htm +++ b/modules/backend/layouts/_head.htm @@ -59,10 +59,10 @@ if (location.protocol === 'https:') { // Unregister all service workers before signing in to prevent cache issues, see github issue: #3707 navigator.serviceWorker.getRegistrations().then( - function(registrations) { - for (let registration of registrations) { + function (registrations) { + registrations.forEach(function (registration) { registration.unregister(); - } + }); } ); } diff --git a/modules/backend/layouts/auth.htm b/modules/backend/layouts/auth.htm index 5b66888aa..344e11e37 100644 --- a/modules/backend/layouts/auth.htm +++ b/modules/backend/layouts/auth.htm @@ -46,10 +46,10 @@ if (location.protocol === 'https:') { // Unregister all service workers before signing in to prevent cache issues, see github issue: #3707 navigator.serviceWorker.getRegistrations().then( - function(registrations) { - for (let registration of registrations) { + function (registrations) { + registrations.forEach(function (registration) { registration.unregister(); - } + }); } ); }