Changeset View
Changeset View
Standalone View
Standalone View
web/olm/olm-utils.js
- This file was added.
// @flow | |||||
import olm from '@matrix-org/olm'; | |||||
declare var olmFilename: string; | |||||
async function initOlm(): Promise<void> { | |||||
if (!olmFilename) { | |||||
return await olm.init(); | |||||
} | |||||
const locateFile = (wasmFilename: string, httpAssetsHost: string) => | |||||
httpAssetsHost + olmFilename; | |||||
return await olm.init({ locateFile }); | |||||
} | |||||
export { initOlm }; |