openimsdk/open-im-sdk-web

微信小程序不支持Worker对象导致心跳失败

CNunicorn6 opened this issue · 1 comments

  • name: open-im-sdk
  • version: 2.3.0

WeChat mini program documentation

Worker
Related documents: Multi threaded Worker

Worker instance, which can be accessed in the main thread through wx.createWorker interface acquisition, which can be obtained through the global variable worker in the worker thread.

src/utils/worker.ts

function create(fun: any) {
  const blob = new Blob(["(" + fun + ")()"]);
  const url = window.URL.createObjectURL(blob);
  const worker = new Worker(url);
  return worker;
}

Please upgrade v3 and try again