You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/11/13 17:36:35 UTC
[whimsy] branch master updated: actually unregister the service
worker
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 <ru...@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" <co...@whimsical.apache.org>'].