From abbb9d99d4c457c9405285772f3845f9bac38fdf Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Mon, 8 Apr 2019 22:06:42 -0700 Subject: [PATCH] Revert "simplify sw unregister" This reverts commit 27f8e1c7b64ada1267b1baf71c849d550399bb41. --- pages/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pages/index.js b/pages/index.js index 45551b8..0762e57 100644 --- a/pages/index.js +++ b/pages/index.js @@ -46,7 +46,13 @@ class Index extends React.Component { function onReset() { clearSettings() - unregister() + if (window.navigator && navigator.serviceWorker) { + navigator.serviceWorker.getRegistrations().then(registrations => { + for (let registration of registrations) { + registration.unregister() + } + }) + } } export default withRouter(Index)