diff --git a/common/hooks.js b/common/hooks.js index 10a0538f..785546a6 100644 --- a/common/hooks.js +++ b/common/hooks.js @@ -425,7 +425,7 @@ export const useLockScroll = ({ lock = true } = {}) => { }, [lock]); }; -export const useWorker = ({ onStart, onMessage, onError, path } = {}, dependencies = []) => { +export const useWorker = ({ onStart, onMessage, onError } = {}, dependencies = []) => { const workerRef = React.useRef(); const onStartRef = React.useRef(); @@ -438,7 +438,7 @@ export const useWorker = ({ onStart, onMessage, onError, path } = {}, dependenci onErrorRef.current = onError; React.useEffect(() => { - const worker = new Worker(new URL(path, import.meta.url)); + const worker = new Worker(new URL("../workers/filter-files.js", import.meta.url)); if (!worker) return; workerRef.current = worker; diff --git a/components/core/Filter/Provider.js b/components/core/Filter/Provider.js index 15ec9dc3..5d91e794 100644 --- a/components/core/Filter/Provider.js +++ b/components/core/Filter/Provider.js @@ -72,7 +72,6 @@ const useFilterWorker = ({ filterState, setFilterObjects, library }) => { useWorker( { - path: "../workers/filter-files.js", onStart: (worker) => { worker.postMessage({ objects: library, view, subview, type }); timeoutRef.current = setTimeout(() => {