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