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 2016/08/01 17:00:19 UTC

[whimsy] branch master updated: enable service workers on test machines

This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/master by this push:
       new  171c64e   enable service workers on test machines
171c64e is described below

commit 171c64e9e9cba75b22a33b07dc1ce7a41c9145d2
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Mon Aug 1 12:59:55 2016 -0400

    enable service workers on test machines
---
 www/board/agenda/views/models/pagecache.js.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/board/agenda/views/models/pagecache.js.rb b/www/board/agenda/views/models/pagecache.js.rb
index e8732f4..c94afcb 100644
--- a/www/board/agenda/views/models/pagecache.js.rb
+++ b/www/board/agenda/views/models/pagecache.js.rb
@@ -15,9 +15,13 @@ class PageCache
       return false
     end
 
-    # disable service workers for now.  See:
+    # disable service workers for the production server(s) for now.  See:
     # https://lists.w3.org/Archives/Public/public-webapps/2016JulSep/0016.html
-    false and defined?(ServiceWorker) and defined?(navigator)
+    if location.hostname =~ /^whimsy.*\.apache\.org$/
+      return false unless location.hostname.include? '-test'
+    end
+
+    defined?(ServiceWorker) and defined?(navigator)
   end
 
   # registration and related startup actions

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