You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Make Olm work with browserified js-sdk
We want to avoid distributing olm as part of the js-sdk, so we exclude it from the browserified build. Previously this meant that you couldn't use olm this way. We can do better though: if the web page includes olm.js via a separate script tag, that will set global.Olm, which we can get browserify to shim in.
This commit is contained in:
@@ -21,6 +21,11 @@ limitations under the License.
|
||||
* @module crypto/OlmDevice
|
||||
*/
|
||||
const Olm = require("olm");
|
||||
if (!Olm) {
|
||||
// this happens if we were loaded via browserify and the Olm module was not
|
||||
// loaded.
|
||||
throw new Error("Olm is not defined");
|
||||
}
|
||||
const utils = require("../utils");
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user