A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix service worker

+7 -8
+1 -1
src/Javascript/Workers/brain.js
··· 26 26 27 27 const app = Elm.Brain.init({ 28 28 flags: { 29 - initialUrl: flags.appHref 29 + initialUrl: flags.appHref || "" 30 30 } 31 31 }) 32 32
+6 -7
src/Javascript/Workers/service.js
··· 16 16 [ "_headers" 17 17 , "_redirects" 18 18 , "CORS" 19 - , "version.js" 20 19 ] 21 20 22 21 ··· 30 29 .then(response => response.json()) 31 30 .then(tree => { 32 31 const filteredTree = tree.filter(t => !exclude.find(u => u === t)) 33 - const whatToCache = [ "" ].concat(filteredTree) 32 + const whatToCache = [ "", ".", "/" ].concat(filteredTree) 34 33 return caches.open(KEY).then(c => Promise.all(whatToCache.map(x => c.add(x)))) 35 34 }) 36 35 ··· 39 38 40 39 41 40 self.addEventListener("fetch", event => { 42 - const isNotLocal = 43 - !event.request.url.match(new RegExp("^https?\:\/\/127.0.0.1")) && 44 - !event.request.url.match(new RegExp("^https?\:\/\/localhost")) 41 + // const isNotLocal = 42 + // !event.request.url.match(new RegExp("^https?\:\/\/127.0.0.1")) && 43 + // !event.request.url.match(new RegExp("^https?\:\/\/localhost")) 45 44 46 45 const isInternal = 47 46 !!event.request.url.match(new RegExp("^" + self.location.origin)) ··· 49 48 const isOffline = 50 49 !self.navigator.onLine 51 50 52 - // Use cache if offline and requesting something non-local and identified as cached (internal) 53 - if (isNotLocal && isInternal && isOffline) { 51 + // Use cache if offline and identified as cached (internal) 52 + if (isInternal && isOffline) { 54 53 const promise = caches 55 54 .match(event.request) 56 55 .then(r => r || fetch(event.request))