浏览代码

fix(e2ee) handle Olm initialization error

If the WASM code could not be loaded, fail to initialize if and remove it from
globals so the E2EE option becomes unavailable, since it will be non-functional.
master
Saúl Ibarra Corretgé 4 年前
父节点
当前提交
3d7ea52416
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      app.js

+ 4
- 1
app.js 查看文件

20
 
20
 
21
 // Initialize Olm as early as possible.
21
 // Initialize Olm as early as possible.
22
 if (window.Olm) {
22
 if (window.Olm) {
23
-    window.Olm.init();
23
+    window.Olm.init().catch(e => {
24
+        console.error('Failed to initialize Olm, E2EE will be disabled', e);
25
+        delete window.Olm;
26
+    });
24
 }
27
 }
25
 
28
 
26
 window.APP = {
29
 window.APP = {

正在加载...
取消
保存