We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8006f9e commit da97b27Copy full SHA for da97b27
src/worker/sw-value-store.js
@@ -43,11 +43,11 @@ function keepAlive() {
43
global.addEventListener('install', event => event.waitUntil(global.skipWaiting()));
44
global.addEventListener('message', event => {
45
const client = event.ports[0];
46
- const action = actions[event.data.action];
47
- if (!action) {
+ if (!actions.hasOwnProperty(event.data.action)) {
48
console.error(`Action '${event.data.action}' doesn't exist in value store service worker`);
49
return;
50
}
+ const action = actions[event.data.action];
51
const value = action(event.data.value);
52
client.postMessage(value);
53
});
0 commit comments