From 0e38eee08047f9fdc64fdcc7f314ff294a73e010 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 14 Jul 2021 17:53:42 +0100 Subject: [PATCH] improve typing in the idb worker --- src/workers/indexeddb.worker.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/workers/indexeddb.worker.ts b/src/workers/indexeddb.worker.ts index 113bc87d6c..a05add1c7d 100644 --- a/src/workers/indexeddb.worker.ts +++ b/src/workers/indexeddb.worker.ts @@ -16,6 +16,8 @@ limitations under the License. import { IndexedDBStoreWorker } from "matrix-js-sdk/src/indexeddb-worker"; -const remoteWorker = new IndexedDBStoreWorker(postMessage as InstanceType["postMessage"]); +const ctx: Worker = self as any; -global.onmessage = remoteWorker.onMessage; +const remoteWorker = new IndexedDBStoreWorker(ctx.postMessage); + +ctx.onmessage = remoteWorker.onMessage;