Skip to content

Commit

Permalink
Fix worker reference
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed Feb 29, 2024
1 parent 3dbf6e1 commit 49ab61c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/scripts/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const createStatisticsService = function () {
) {
const columns = createColumns(data.corpora, reduceVals, reduceValLabels)

const statsWorker = new Worker("worker.js")
const statsWorker = new Worker(new URL("./statistics_worker.ts", import.meta.url))
statsWorker.onmessage = function (e) {
const searchParams = {
reduceVals,
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/statistics_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { StatsData, RowsEntity, Value } from "./interfaces/stats"
onmessage = function (e) {
const data: StatsData = e.data.data

// Ignore messages sent by WebPack dev server.
if (e.data.type?.includes("webpack")) return

const { combined, corpora, count } = data
const reduceVals: string[] = e.data.reduceVals
const groupStatistics: string[] = e.data.groupStatistics
Expand Down

0 comments on commit 49ab61c

Please sign in to comment.