Explorar o código

serviceworker, send fileCache even if empty

Artur Paikin %!s(int64=7) %!d(string=hai) anos
pai
achega
0a23a4ac0c
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      examples/bundled-example/sw.js

+ 5 - 4
examples/bundled-example/sw.js

@@ -32,10 +32,11 @@ function removeFile (fileID) {
 }
 
 function getFiles () {
-  console.log(Object.keys(fileCache))
-  if (Object.keys(fileCache).length > 0) {
-    sendMessageToAllClients({ type: 'ALL_FILES', files: fileCache })
-  }
+  // console.log(Object.keys(fileCache))
+  sendMessageToAllClients({ type: 'ALL_FILES', files: fileCache })
+  // if (Object.keys(fileCache).length > 0) {
+  //   sendMessageToAllClients({ type: 'ALL_FILES', files: fileCache })
+  // }
 }
 
 self.addEventListener('message', (event) => {