Skip to content

Commit

Permalink
Improve worker compatibility with Safari (again).
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jun 25, 2021
1 parent a7ebe5e commit c9a1373
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cubing/solve/vendor/comlink-everywhere/inside/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expose as comlinkExpose } from "comlink";

const useNodeWorkarounds = typeof globalThis.Worker === "undefined";
const useNodeWorkarounds =
typeof globalThis.Worker === "undefined" &&
typeof globalThis.WorkerNavigator === "undefined";

export function expose(api) {
if (useNodeWorkarounds) {
Expand Down
4 changes: 3 additions & 1 deletion src/cubing/solve/vendor/comlink-everywhere/outside/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export { wrap } from "comlink";

const useNodeWorkarounds = typeof globalThis.Worker === "undefined";
const useNodeWorkarounds =
typeof globalThis.Worker === "undefined" &&
typeof globalThis.WorkerNavigator === "undefined";

export async function workerFileConstructor() {
if (useNodeWorkarounds) {
Expand Down

0 comments on commit c9a1373

Please sign in to comment.