fix web worker

This commit is contained in:
rendi12345678 2024-08-17 13:09:07 +07:00
parent a68f7ca1c1
commit 1a4e7d0ca8
2 changed files with 14 additions and 9 deletions

19
package-lock.json generated
View File

@ -5518,9 +5518,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001331",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001331.tgz",
"integrity": "sha512-Y1xk6paHpUXKP/P6YjQv1xqyTbgAP05ycHBcRdQjTcyXlWol868sJJPlmk5ylOekw2BrucWes5jk+LvVd7WZ5Q==",
"version": "1.0.30001651",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz",
"integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==",
"funding": [
{
"type": "opencollective",
@ -5529,8 +5529,13 @@
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
]
],
"license": "CC-BY-4.0"
},
"node_modules/case-sensitive-paths-webpack-plugin": {
"version": "2.4.0",
@ -20738,9 +20743,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001331",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001331.tgz",
"integrity": "sha512-Y1xk6paHpUXKP/P6YjQv1xqyTbgAP05ycHBcRdQjTcyXlWol868sJJPlmk5ylOekw2BrucWes5jk+LvVd7WZ5Q=="
"version": "1.0.30001651",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz",
"integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg=="
},
"case-sensitive-paths-webpack-plugin": {
"version": "2.4.0",

View File

@ -414,7 +414,7 @@ const TypeBox = ({
useEffect(() => {
// Initialize worker
wpmWorkerRef.current = WorkerBuilder(calculateWpmWorker);
wpmWorkerRef.current = new WorkerBuilder(calculateWpmWorker);
return () => {
// Cleanup worker on component unmount
@ -588,7 +588,7 @@ const TypeBox = ({
const workerRef = useRef(null);
useEffect(() => {
workerRef.current = WorkerBuilder(checkPrevWorker);
workerRef.current = new WorkerBuilder(checkPrevWorker);
return () => {
if (workerRef.current) {