diff --git a/src/dataproxy/worker/shared-worker.ts b/src/dataproxy/worker/shared-worker.ts index 961de13..9bf3460 100644 --- a/src/dataproxy/worker/shared-worker.ts +++ b/src/dataproxy/worker/shared-worker.ts @@ -85,13 +85,12 @@ const updateState = (): void => { if (client && searchEngine && searchEngine.searchIndexes) { state.status = 'Ready' - state.indexLength = Object.keys(searchEngine.searchIndexes).map( - (indexKey: string) => ({ - doctype: indexKey, + state.indexLength = Object.entries(searchEngine.searchIndexes).map( + ([doctype, searchIndex]) => ({ + doctype, // @ts-expect-error index.store is not TS typed // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - count: Object.keys(searchEngine.searchIndexes[indexKey].index.store) - .length + count: Object.keys(searchIndex.index.store).length }) ) broadcastChannel.postMessage(state)