whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: actually unregister the service worker
Date Mon, 13 Nov 2017 17:36:35 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new d2bba6c  actually unregister the service worker
d2bba6c is described below

commit d2bba6cc54d1b238dcc881d589dc306f7cdbca96
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Nov 13 12:36:23 2017 -0500

    actually unregister the service worker
---
 www/board/agenda/views/models/pagecache.js.rb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/www/board/agenda/views/models/pagecache.js.rb b/www/board/agenda/views/models/pagecache.js.rb
index d81dd30..253c908 100644
--- a/www/board/agenda/views/models/pagecache.js.rb
+++ b/www/board/agenda/views/models/pagecache.js.rb
@@ -18,7 +18,16 @@ class PageCache
     # disable service workers for the production server(s) for now.  See:
     # https://lists.w3.org/Archives/Public/public-webapps/2016JulSep/0016.html
     if location.hostname =~ /^whimsy.*\.apache\.org$/
-      return false unless location.hostname.include? '-test'
+      unless location.hostname.include? '-test'
+        # unregister service worker
+        navigator.serviceWorker.getRegistrations().then do |registrations|
+          registrations.each do |registration|
+            registration.unregister()
+          end
+        end
+
+        return false
+      end
     end
 
     defined?(ServiceWorker) and defined?(navigator)

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message