mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
make olmPath absolute if it isn't already
This commit is contained in:
parent
9a3f74c6fb
commit
155cd4c9bd
@ -80,8 +80,16 @@ function relPath(path, basePath) {
|
||||
async function loadOlmWorker(config) {
|
||||
const workerPool = new WorkerPool(config.worker, 4);
|
||||
await workerPool.init();
|
||||
const path = relPath(config.olm.legacyBundle, config.worker);
|
||||
await workerPool.sendAll({type: "load_olm", path});
|
||||
let olmPath = config.olm.legacyBundle;
|
||||
// convert olm path to absolute path
|
||||
if (!olmPath.startsWith("/")) {
|
||||
olmPath = new URL(olmPath, document.location.href).pathname;
|
||||
console.log("olmPath", config.olm.legacyBundle, olmPath);
|
||||
}
|
||||
await workerPool.sendAll({
|
||||
type: "load_olm",
|
||||
path: olmPath
|
||||
});
|
||||
const olmWorker = new OlmWorker(workerPool);
|
||||
return olmWorker;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ let polyfillRef;
|
||||
export default {
|
||||
public: false,
|
||||
root: "src/platform/web",
|
||||
base: "./",
|
||||
server: {
|
||||
hmr: false
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user