If sending arraybuffer back, use a transferable object
This commit is contained in:
parent
7b169fb798
commit
f638bd4ded
@ -101,14 +101,23 @@ async function bake(data) {
|
|||||||
data.progress, // The current position in the recipe
|
data.progress, // The current position in the recipe
|
||||||
data.step // Whether or not to take one step or execute the whole recipe
|
data.step // Whether or not to take one step or execute the whole recipe
|
||||||
);
|
);
|
||||||
|
if (typeof response.result === "string") {
|
||||||
self.postMessage({
|
self.postMessage({
|
||||||
action: "bakeComplete",
|
action: "bakeComplete",
|
||||||
data: Object.assign(response, {
|
data: Object.assign(response, {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
inputNum: data.inputNum
|
inputNum: data.inputNum
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
self.postMessage({
|
||||||
|
action: "bakeComplete",
|
||||||
|
data: Object.assign(response, {
|
||||||
|
id: data.id,
|
||||||
|
inputNum: data.inputNum
|
||||||
|
})
|
||||||
|
}, [response.result]);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
self.postMessage({
|
self.postMessage({
|
||||||
action: "bakeError",
|
action: "bakeError",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user