mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Try to fix webworker bug - Attempt 2
This commit is contained in:
parent
0d555e22c7
commit
64b983b94e
@ -12,13 +12,13 @@ function accessNestedPropertyReverse(obj, keys) {
|
||||
|
||||
const salt = accessNestedPropertyReverse(globalConfig, ["file", "info"]);
|
||||
|
||||
onmessage = function (event) {
|
||||
self.addEventListener("message", event => {
|
||||
const { jobId, job, data } = event.data;
|
||||
console.log("[worker] Received message:");
|
||||
console.log(JSON.stringify(event.data));
|
||||
const result = performJob(job, data);
|
||||
postMessage({ jobId, result });
|
||||
};
|
||||
});
|
||||
|
||||
function performJob(job, data) {
|
||||
switch (job) {
|
||||
|
Loading…
Reference in New Issue
Block a user