From 83bf351a34a65edb7ab9eaf4251b197cbeedb159 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 May 2020 17:10:02 +0100 Subject: fix build on latest emscripten --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7651b66..04ec18c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ JS_ASMJS_TARGET := javascript/olm_legacy.js WASM_TARGET := $(BUILD_DIR)/wasm/libolm.a JS_EXPORTED_FUNCTIONS := javascript/exported_functions.json -JS_EXTRA_EXPORTED_RUNTIME_METHODS := ALLOC_STACK +JS_EXTRA_EXPORTED_RUNTIME_METHODS := [ALLOC_STACK] JS_EXTERNS := javascript/externs.js PUBLIC_HEADERS := include/olm/olm.h include/olm/outbound_group_session.h include/olm/inbound_group_session.h include/olm/pk.h include/olm/sas.h -- cgit v1.2.3 From fdf25eb3ba31d4c57d50f70a1dacae6fc1c00959 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 May 2020 17:10:18 +0100 Subject: spell out error msg if you don't Olm.init --- javascript/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/javascript/README.md b/javascript/README.md index d2f1d72..bdf0224 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -2,7 +2,8 @@ Olm === Note: before using any of the olm functions, you must call `Olm.init()`, and -wait for the promise to resolve. +wait for the promise to resolve, otherwise you will get errors like: +`Uncaught TypeError: Olm.Account is not a constructor` Example: -- cgit v1.2.3 From 14c1db02fe8a5730c840949b2639ccfa99fe84a6 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 May 2020 17:10:32 +0100 Subject: fix 1:1 demo to work with Olm.init() --- javascript/demo/one_to_one_demo.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/javascript/demo/one_to_one_demo.html b/javascript/demo/one_to_one_demo.html index fc7e654..a225e4a 100644 --- a/javascript/demo/one_to_one_demo.html +++ b/javascript/demo/one_to_one_demo.html @@ -2,7 +2,13 @@ -- cgit v1.2.3 From ddd140b23d4352f7fb5164c42db3ef5e1714fe36 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 May 2020 17:11:54 +0100 Subject: fix group demo to work with Olm.init() --- javascript/demo/group_demo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/javascript/demo/group_demo.js b/javascript/demo/group_demo.js index 42a3d84..7cd9e3e 100644 --- a/javascript/demo/group_demo.js +++ b/javascript/demo/group_demo.js @@ -489,4 +489,8 @@ function startDemo() { } -document.addEventListener("DOMContentLoaded", startDemo, false); +document.addEventListener("DOMContentLoaded", function() { + Olm.init().then(function() { + startDemo(); + }); +}, false); -- cgit v1.2.3